PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.7.0
Shortcodes and extra features for Phlox theme v1.7.0
2.17.22 2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / video.php
auxin-elements / includes / elements Last commit date
about-widget.php 8 years ago accordion-api.php 9 years ago accordion.php 8 years ago attachment-url.php 9 years ago audio.php 8 years ago before-after.php 8 years ago button.php 8 years ago code.php 8 years ago contact-box.php 8 years ago contact-form.php 8 years ago divider.php 8 years ago dropcap.php 8 years ago facebook.php 8 years ago flickr.php 8 years ago gallery.php 8 years ago gmap.php 8 years ago highlight.php 8 years ago image.php 8 years ago instagram-feed.php 8 years ago latest-items.php 8 years ago latest-posts-slider.php 8 years ago popular-posts-widget.php 8 years ago quote.php 8 years ago recent-posts-grid-carousel.php 8 years ago recent-posts-land-style.php 8 years ago recent-posts-masonry.php 8 years ago recent-posts-tiles.php 8 years ago recent-posts-timeline.php 8 years ago recent-posts-widget.php 8 years ago recent-posts.php 9 years ago related-posts.php 9 years ago sample-element.php 9 years ago search.php 8 years ago slider.php 9 years ago socials-list.php 8 years ago staff.php 8 years ago tabs-api.php 9 years ago tabs.php 8 years ago testimonial.php 8 years ago testomonial.php 8 years ago text.php 8 years ago touch-slider.php 8 years ago video.php 8 years ago
video.php
269 lines
1 <?php
2 /**
3 * Video player element
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author
9 * @link http://averta.net/phlox/
10 * @copyright (c) 2010-2017
11 */
12 function auxin_get_video_master_array( $master_array ) {
13
14 $master_array['aux_video'] = array(
15 'name' => __('Video', 'auxin-elements'),
16 'auxin_output_callback' => 'auxin_widget_video_callback',
17 'base' => 'aux_video',
18 'description' => __('It adds a video player element.', 'auxin-elements'),
19 'class' => 'aux-widget-video',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'category' => THEME_NAME,
23 'group' => '',
24 'admin_enqueue_js' => '',
25 'admin_enqueue_css' => '',
26 'front_enqueue_js' => '',
27 'front_enqueue_css' => '',
28 'icon' => 'aux-element aux-pb-icons-video',
29 'custom_markup' => '',
30 'js_view' => '',
31 'html_template' => '',
32 'deprecated' => '',
33 'content_element' => '',
34 'as_parent' => '',
35 'as_child' => '',
36 'params' => array(
37 array(
38 'heading' => __('Title','auxin-elements'),
39 'description' => __('Video title, leave it empty if you don`t need title.', 'auxin-elements'),
40 'param_name' => 'title',
41 'type' => 'textfield',
42 'value' => '',
43 'holder' => 'textfield',
44 'class' => 'title',
45 'admin_label' => false,
46 'dependency' => '',
47 'weight' => '',
48 'group' => '',
49 'edit_field_class' => ''
50 ),
51 array(
52 'heading' => __('Autoplay','auxin-elements'),
53 'description' => __('Whether to start the video automatically or not.','auxin-elements'),
54 'param_name' => 'autoplay',
55 'type' => 'aux_switch',
56 'value' => '0',
57 'class' => 'autoplay',
58 'admin_label' => false,
59 'dependency' => '',
60 'weight' => '',
61 'group' => '',
62 'edit_field_class' => ''
63 ),
64 array(
65 'heading' => __('Repeat video','auxin-elements'),
66 'description' => __('Play video again when it ends.','auxin-elements'),
67 'param_name' => 'loop',
68 'type' => 'aux_switch',
69 'value' => '0',
70 'class' => 'loop',
71 'admin_label' => true,
72 'dependency' => '',
73 'weight' => '',
74 'group' => '',
75 'edit_field_class' => ''
76 ),
77 array(
78 'heading' => __('Width','auxin-elements'),
79 'description' => __('Width size of video in pixel.','auxin-elements'),
80 'param_name' => 'width',
81 'type' => 'textfield',
82 'value' => '1200',
83 'holder' => '',
84 'class' => '',
85 'admin_label' => false,
86 'dependency' => '',
87 'weight' => '',
88 'group' => 'Style',
89 'edit_field_class' => ''
90 ),
91 array(
92 'heading' => __('Height','auxin-elements'),
93 'description' => __('Height size of video in pixel.','auxin-elements'),
94 'param_name' => 'height',
95 'type' => 'textfield',
96 'value' => '675',
97 'holder' => '',
98 'class' => '',
99 'admin_label' => false,
100 'dependency' => '',
101 'weight' => '',
102 'group' => 'Style',
103 'edit_field_class' => ''
104 ),
105 array(
106 'heading' => __('Video file','auxin-elements'),
107 'description' => __('Please upload the video file.','auxin-elements'),
108 'param_name' => 'src',
109 'type' => 'aux_select_video',
110 'value' => '',
111 'holder' => '',
112 'class' => '',
113 'admin_label' => false,
114 'dependency' => '',
115 'weight' => '',
116 'group' => '',
117 'edit_field_class' => ''
118 ),
119 array(
120 'heading' => __('Video link','auxin-elements'),
121 'description' => __('Youtube, Vimeo or any video embed link.','auxin-elements'),
122 'param_name' => 'url',
123 'type' => 'textfield',
124 'value' => '',
125 'holder' => '',
126 'class' => '',
127 'admin_label' => false,
128 'dependency' => '',
129 'weight' => '',
130 'group' => '',
131 'edit_field_class' => ''
132 ),
133 array(
134 'heading' => __('Video poster','auxin-elements'),
135 'description' => __('An image that represents the video content.','auxin-elements'),
136 'param_name' => 'poster',
137 'type' => 'textfield',
138 'value' => '',
139 'holder' => '',
140 'class' => '',
141 'admin_label' => false,
142 'dependency' => '',
143 'weight' => '',
144 'group' => '',
145 'edit_field_class' => ''
146 ),
147 array(
148 'heading' => __('Player skin','auxin-elements'),
149 'description' => __('Specifies skin for the player.','auxin-elements'),
150 'param_name' => 'skin',
151 'type' => 'aux_visual_select',
152 'def_value' => 'dark',
153 'choices' => array(
154 'dark' => array(
155 'label' => __('Dark', 'auxin-elements'),
156 'image' => AUXIN_URL . 'images/visual-select/audio-player-dark.svg'
157 ),
158 'light' => array(
159 'label' => __('Light', 'auxin-elements'),
160 'image' => AUXIN_URL . 'images/visual-select/audio-player-light.svg'
161 )
162 ),
163 'holder' => '',
164 'class' => 'skin',
165 'admin_label' => true,
166 'dependency' => '',
167 'weight' => '',
168 'group' => 'Style',
169 'edit_field_class' => ''
170 ),
171 array(
172 'heading' => __('Extra class name','auxin-elements'),
173 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements'),
174 'param_name' => 'extra_classes',
175 'type' => 'textfield',
176 'value' => '',
177 'holder' => '',
178 'class' => 'extra_classes',
179 'admin_label' => false,
180 'dependency' => '',
181 'weight' => '',
182 'group' => '',
183 'edit_field_class' => ''
184 )
185
186 )
187 );
188
189 return $master_array;
190 }
191
192 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_video_master_array', 10, 1 );
193
194
195
196
197 function auxin_widget_video_callback( $atts, $shortcode_content = null ){
198
199 // Defining default attributes
200 $default_atts = array(
201 'title' => '', // header title
202
203 'autoplay' => '', // play video automatically
204 'loop' => '', // loop video
205 'preload' => 'metadata',
206 'width' => '1200', // default video size
207 'height' => '675', // default video height
208 'url' => '', // embed video link
209 'src' => '', // quick set for mp4 file
210 'poster' => '',
211 'skin' => 'dark', // dark or light
212
213 'extra_classes' => '', // custom css class names for this element
214 'custom_el_id' => '', // custom id attribute for this element
215 'base_class' => 'aux-widget-video' // base class name for container
216 );
217
218 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
219 extract( $result['parsed_atts'] );
220
221 ob_start();
222
223 // widget header ------------------------------
224 echo $result['widget_header'];
225 echo $result['widget_title'];
226
227 if( empty( $skin ) ){
228 $skin = 'light';
229 }
230
231 $class = 'wp-video-shortcode aux-player-' . esc_attr( $skin );
232
233 // convert attachment id to url
234 if( is_numeric( $src ) ){
235 $src = wp_get_attachment_url( $src );
236 }
237
238 // convert attachment id to url
239 if( is_numeric( $poster ) ){
240 $poster = wp_get_attachment_url( $poster );
241 }
242
243 if( $provider = auxin_extract_embed_provider_name( $src ) ){
244 $class .= ' aux-provider-'. $provider;
245 }
246
247 if( ! empty( $src ) ){
248
249 echo do_shortcode(
250 sprintf(
251 '[video src="%s" loop="%s" autoplay="%s" preload="%s" class="%s" width="%s" height="%s" poster="%s" ]',
252 $src, $loop, $autoplay, $preload, $class, $width, $height, $poster
253 )
254 );
255
256 } elseif( ! empty( $url ) ){
257
258 echo wp_oembed_get( $url, array(
259 'width' => $width,
260 'height' => $height
261 ));
262 }
263
264 // widget footer ------------------------------
265 echo $result['widget_footer'];
266
267 return ob_get_clean();
268 }
269