PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.0.2
Shortcodes and extra features for Phlox theme v1.0.2
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 10 years ago accordion.php 10 years ago attachment-url.php 10 years ago audio.php 10 years ago button.php 10 years ago code.php 10 years ago contact-box.php 10 years ago contact-form.php 10 years ago divider.php 10 years ago dropcap.php 10 years ago gallery.php 10 years ago gmap.php 10 years ago highlight.php 10 years ago image.php 10 years ago instagram-feed.php 10 years ago latest-items.php 10 years ago latest-posts-slider.php 10 years ago quote.php 10 years ago recent-posts-widget.php 10 years ago recent-posts.php 10 years ago sample-element.php 10 years ago search.php 10 years ago socials-list.php 10 years ago tabs.php 10 years ago text.php 10 years ago video.php 10 years ago
video.php
278 lines
1 <?php
2 /**
3 * Video player element
4 *
5 *
6 * @package auxin-elements
7 * @license LICENSE.txt
8 * @author
9 * @link https://bitbucket.org/averta/
10 * @copyright (c) 2010-2016
11 */
12 function auxin_get_video_master_array( $master_array ) {
13
14 $master_array['aux_video'] = array(
15 'name' => __('[Phlox] 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' => 'auxin-element auxin-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 'param_name' => 'title',
39 'type' => 'textfield',
40 'value' => '',
41 'def_value' => '',
42 'holder' => 'textfield',
43 'class' => 'title',
44 'heading' => __('Title','auxin-elements'),
45 'description' => __('The video title.', 'auxin-elements'),
46 'admin_label' => true,
47 'dependency' => '',
48 'weight' => '',
49 'group' => '' ,
50 'edit_field_class' => ''
51 ),
52 array(
53 'param_name' => 'autoplay',
54 'type' => 'aux_switch',
55 'def_value' => '0',
56 'value' => '0',
57 'class' => 'autoplay',
58 'heading' => __('Autoplay? ','auxin-elements'),
59 'description' => __('Whether to start the video automatically or not','auxin-elements'),
60 'admin_label' => true,
61 'dependency' => '',
62 'weight' => '',
63 'group' => '' ,
64 'edit_field_class' => ''
65 ),
66 array(
67 'param_name' => 'loop',
68 'type' => 'aux_switch',
69 'def_value' => '0',
70 'value' => '0',
71 'class' => 'loop',
72 'heading' => __('Repeat video','auxin-elements'),
73 'description' => __('Repeat video again when it ends.','auxin-elements'),
74 'admin_label' => true,
75 'dependency' => '',
76 'weight' => '',
77 'group' => '' ,
78 'edit_field_class' => ''
79 ),
80 array(
81 'param_name' => 'width',
82 'type' => 'textfield',
83 'value' => '',
84 'def_value' => '',
85 'holder' => 'textfield',
86 'class' => '',
87 'heading' => __('Width','auxin-elements'),
88 'description' => __('The width of video in pixel','auxin-elements'),
89 'admin_label' => true,
90 'dependency' => '',
91 'weight' => '',
92 'group' => '' ,
93 'edit_field_class' => ''
94 ),
95 array(
96 'param_name' => 'height',
97 'type' => 'textfield',
98 'value' => '',
99 'def_value' => '',
100 'holder' => 'textfield',
101 'class' => '',
102 'heading' => __('Height','auxin-elements'),
103 'description' => __('The height of video in pixel','auxin-elements'),
104 'admin_label' => true,
105 'dependency' => '',
106 'weight' => '',
107 'group' => '' ,
108 'edit_field_class' => ''
109 ),
110 array(
111 'param_name' => 'src',
112 'type' => 'aux_select_video',
113 'value' => '',
114 'def_value' => '',
115 'holder' => 'aux_select_video',
116 'class' => '',
117 'heading' => __('Video file','auxin-elements'),
118 'description' => __('Please upload the video file','auxin-elements'),
119 'admin_label' => true,
120 'dependency' => '',
121 'weight' => '',
122 'group' => '' ,
123 'edit_field_class' => ''
124 ),
125 array(
126 'param_name' => 'url',
127 'type' => 'textfield',
128 'value' => '',
129 'def_value' => '',
130 'holder' => 'textfield',
131 'class' => '',
132 'heading' => __('Video Link','auxin-elements'),
133 'description' => __('The youtube, vimeo or any video embed link','auxin-elements'),
134 'admin_label' => true,
135 'dependency' => '',
136 'weight' => '',
137 'group' => '' ,
138 'edit_field_class' => ''
139 ),
140 array(
141 'param_name' => 'poster',
142 'type' => 'textfield',
143 'value' => '',
144 'def_value' => '',
145 'holder' => 'textfield',
146 'class' => '',
147 'heading' => __('Video poster','auxin-elements'),
148 'description' => __('An image that represents the video content','auxin-elements'),
149 'admin_label' => true,
150 'dependency' => '',
151 'weight' => '',
152 'group' => '' ,
153 'edit_field_class' => ''
154 ),
155 array(
156 'param_name' => 'skin',
157 'type' => 'aux_visual_select',
158 'def_value' => 'dark',
159 'choices' => array(
160 'dark' => array(
161 'label' => __('Dark', 'auxin-elements'),
162 'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
163 ),
164 'light' => array(
165 'label' => __('Light', 'auxin-elements'),
166 'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
167 )
168 ),
169 'holder' => 'dropdown',
170 'class' => 'skin',
171 'heading' => __('Player skin ','auxin-elements'),
172 'description' => __('Specifies skin for the player','auxin-elements'),
173 'admin_label' => true,
174 'dependency' => '',
175 'weight' => '',
176 'group' => '' ,
177 'edit_field_class' => ''
178 ),
179 array(
180 'param_name' => 'extra_classes',
181 'type' => 'textfield',
182 'value' => '',
183 'def_value' => '',
184 'holder' => 'textfield',
185 'class' => 'extra_classes',
186 'heading' => __('Extra class name','auxin-elements'),
187 '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'),
188 'admin_label' => true,
189 'dependency' => '',
190 'weight' => '',
191 'group' => '' ,
192 'edit_field_class' => ''
193 )
194
195 )
196 );
197
198 return $master_array;
199 }
200
201 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_video_master_array', 10, 1 );
202
203
204
205
206 function auxin_widget_video_callback( $atts, $shortcode_content = null ){
207
208 // Defining default attributes
209 $default_atts = array(
210 'title' => '', // header title
211
212 'autoplay' => '', // play video automatically
213 'loop' => '', // loop video
214 'preload' => 'metadata',
215 'width' => '1200', // default video size
216 'height' => '675', // default video height
217 'url' => '', // embed video link
218 'src' => '', // quick set for mp4 file
219 'poster' => '',
220 'skin' => '', // dark or light
221
222 'extra_classes' => '', // custom css class names for this element
223 'custom_el_id' => '', // custom id attribute for this element
224 'base_class' => 'aux-widget-video' // base class name for container
225 );
226
227 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
228 extract( $result['parsed_atts'] );
229
230 ob_start();
231
232 // widget header ------------------------------
233 echo $result['widget_header'];
234 echo $result['widget_title'];
235
236 if( empty( $skin ) ){
237 $skin = 'light';
238 }
239
240 $class = 'wp-video-shortcode aux-player-' . esc_attr( $skin );
241
242 // convert attachment id to url
243 if( is_numeric( $src ) ){
244 $src = wp_get_attachment_url( $src );
245 }
246
247 // convert attachment id to url
248 if( is_numeric( $poster ) ){
249 $poster = wp_get_attachment_url( $poster );
250 }
251
252 if( $provider = auxin_extract_embed_provider_name( $src ) ){
253 $class .= ' aux-provider-'. $provider;
254 }
255
256 if( ! empty( $src ) ){
257
258 echo do_shortcode(
259 sprintf(
260 '[video src="%s" loop="%s" autoplay="%s" preload="%s" class="%s" width="%s" height="%s" poster="%s" ]',
261 $src, $loop, $autoplay, $preload, $class, $width, $height, $poster
262 )
263 );
264
265 } else if( ! empty( $url ) ){
266
267 echo wp_oembed_get( $url, array(
268 'width' => $width,
269 'height' => $height
270 ));
271 }
272
273 // widget footer ------------------------------
274 echo $result['widget_footer'];
275
276 return ob_get_clean();
277 }
278