PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.3.1
Shortcodes and extra features for Phlox theme v1.3.1
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 9 years ago accordion-api.php 9 years ago accordion.php 9 years ago attachment-url.php 10 years ago audio.php 9 years ago button.php 9 years ago code.php 9 years ago contact-box.php 9 years ago contact-form.php 9 years ago divider.php 9 years ago dropcap.php 9 years ago facebook.php 9 years ago flickr.php 9 years ago gallery.php 9 years ago gmap.php 9 years ago highlight.php 9 years ago image.php 9 years ago instagram-feed.php 9 years ago latest-items.php 10 years ago latest-posts-slider.php 9 years ago popular-posts-widget.php 9 years ago quote.php 9 years ago recent-posts-grid-carousel.php 9 years ago recent-posts-land-style.php 9 years ago recent-posts-masonry.php 9 years ago recent-posts-tiles.php 9 years ago recent-posts-timeline.php 9 years ago recent-posts-widget.php 9 years ago recent-posts.php 9 years ago sample-element.php 10 years ago search.php 9 years ago socials-list.php 9 years ago tabs-api.php 9 years ago tabs.php 9 years ago text.php 9 years ago video.php 9 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 '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 'def_value' => '',
44 'holder' => 'textfield',
45 'class' => 'title',
46 'admin_label' => true,
47 'dependency' => '',
48 'weight' => '',
49 'group' => '' ,
50 'edit_field_class' => ''
51 ),
52 array(
53 'heading' => __('Autoplay','auxin-elements'),
54 'description' => __('Whether to start the video automatically or not.','auxin-elements'),
55 'param_name' => 'autoplay',
56 'type' => 'aux_switch',
57 'def_value' => '0',
58 'value' => '0',
59 'class' => 'autoplay',
60 'admin_label' => true,
61 'dependency' => '',
62 'weight' => '',
63 'group' => '' ,
64 'edit_field_class' => ''
65 ),
66 array(
67 'heading' => __('Repeat video','auxin-elements'),
68 'description' => __('Play video again when it ends.','auxin-elements'),
69 'param_name' => 'loop',
70 'type' => 'aux_switch',
71 'def_value' => '0',
72 'value' => '0',
73 'class' => 'loop',
74 'admin_label' => true,
75 'dependency' => '',
76 'weight' => '',
77 'group' => 'Extras' ,
78 'edit_field_class' => ''
79 ),
80 array(
81 'heading' => __('Width','auxin-elements'),
82 'description' => __('Width size of video in pixel.','auxin-elements'),
83 'param_name' => 'width',
84 'type' => 'textfield',
85 'value' => '',
86 'def_value' => '',
87 'holder' => 'textfield',
88 'class' => '',
89 'admin_label' => true,
90 'dependency' => '',
91 'weight' => '',
92 'group' => '' ,
93 'edit_field_class' => ''
94 ),
95 array(
96 'heading' => __('Height','auxin-elements'),
97 'description' => __('Height size of video in pixel.','auxin-elements'),
98 'param_name' => 'height',
99 'type' => 'textfield',
100 'value' => '',
101 'def_value' => '',
102 'holder' => 'textfield',
103 'class' => '',
104 'admin_label' => true,
105 'dependency' => '',
106 'weight' => '',
107 'group' => '' ,
108 'edit_field_class' => ''
109 ),
110 array(
111 'heading' => __('Video file','auxin-elements'),
112 'description' => __('Please upload the video file.','auxin-elements'),
113 'param_name' => 'src',
114 'type' => 'aux_select_video',
115 'value' => '',
116 'def_value' => '',
117 'holder' => 'aux_select_video',
118 'class' => '',
119 'admin_label' => true,
120 'dependency' => '',
121 'weight' => '',
122 'group' => '' ,
123 'edit_field_class' => ''
124 ),
125 array(
126 'heading' => __('Video link','auxin-elements'),
127 'description' => __('Youtube, Vimeo or any video embed link.','auxin-elements'),
128 'param_name' => 'url',
129 'type' => 'textfield',
130 'value' => '',
131 'def_value' => '',
132 'holder' => 'textfield',
133 'class' => '',
134 'admin_label' => true,
135 'dependency' => '',
136 'weight' => '',
137 'group' => '' ,
138 'edit_field_class' => ''
139 ),
140 array(
141 'heading' => __('Video poster','auxin-elements'),
142 'description' => __('An image that represents the video content.','auxin-elements'),
143 'param_name' => 'poster',
144 'type' => 'textfield',
145 'value' => '',
146 'def_value' => '',
147 'holder' => 'textfield',
148 'class' => '',
149 'admin_label' => true,
150 'dependency' => '',
151 'weight' => '',
152 'group' => '' ,
153 'edit_field_class' => ''
154 ),
155 array(
156 'heading' => __('Player skin ','auxin-elements'),
157 'description' => __('Specifies skin for the player.','auxin-elements'),
158 'param_name' => 'skin',
159 'type' => 'aux_visual_select',
160 'def_value' => 'dark',
161 'choices' => array(
162 'dark' => array(
163 'label' => __('Dark', 'auxin-elements'),
164 'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
165 ),
166 'light' => array(
167 'label' => __('Light', 'auxin-elements'),
168 'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
169 )
170 ),
171 'holder' => 'dropdown',
172 'class' => 'skin',
173 'admin_label' => true,
174 'dependency' => '',
175 'weight' => '',
176 'group' => 'Extras' ,
177 'edit_field_class' => ''
178 ),
179 array(
180 'heading' => __('Extra class name','auxin-elements'),
181 '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'),
182 'param_name' => 'extra_classes',
183 'type' => 'textfield',
184 'value' => '',
185 'def_value' => '',
186 'holder' => 'textfield',
187 'class' => 'extra_classes',
188 'admin_label' => true,
189 'dependency' => '',
190 'weight' => '',
191 'group' => 'Extras' ,
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