Video Background - Version 2.5.4

Version Description

  • Fixed a bug that made the browser position jump when clicking the "Advanced Options" button
  • Added better localization support for translations
  • Cleaner code, well documented.
  • Added Muted Video Background Pro fields (Do not worry, you can hide these)
  • Added new stable tag for WP 4.5.3
Download this release

Release Info

Developer blakedotvegas
Plugin Icon 128x128 Video Background
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

admin_premium_notice.php CHANGED
@@ -1,22 +1,28 @@
1
  <?php
2
  /**
3
  * Create the premium notice message
 
 
 
 
4
  */
5
  function vidbg_premium_notice() {
6
  $class = 'notice notice-success vidbg-premium-notice is-dismissible';
7
- $message = __( 'Youtube, Visual Composer, and SiteOrigin Integration with much more in the new Video Background Pro! <a href="http://pushlabs.co/video-background-pro" target="_blank">Learn more &raquo;</a>', 'video-background' );
8
- $is_dismissed = get_option( 'vidbgpro-notice-dismissed' );
9
 
10
- if( empty( $is_dismissed ) ) {
11
- printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
12
- }
13
  }
14
  add_action( 'admin_notices', 'vidbg_premium_notice' );
15
 
16
-
17
-
18
  /**
19
  * Ajax handler to permanently dismiss notice
 
 
 
 
20
  */
21
  function vidbg_dismiss_premium_notice() {
22
  update_option( 'vidbgpro-notice-dismissed', 1 );
1
  <?php
2
  /**
3
  * Create the premium notice message
4
+ *
5
+ * @since 2.5.1
6
+ *
7
+ * @uses get_option()
8
  */
9
  function vidbg_premium_notice() {
10
  $class = 'notice notice-success vidbg-premium-notice is-dismissible';
11
+ $message = __( 'Want more options like YouTube video backgrounds and frontend play/volume buttons in Video Background? <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">Check out the new Video Background Pro!</a>', 'video-background' );
12
+ $is_dismissed = get_option( 'vidbgpro-notice-dismissed' );
13
 
14
+ if( empty( $is_dismissed ) ) {
15
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
16
+ }
17
  }
18
  add_action( 'admin_notices', 'vidbg_premium_notice' );
19
 
 
 
20
  /**
21
  * Ajax handler to permanently dismiss notice
22
+ *
23
+ * @since 2.5.1
24
+ *
25
+ * @uses update_option()
26
  */
27
  function vidbg_dismiss_premium_notice() {
28
  update_option( 'vidbgpro-notice-dismissed', 1 );
candide-vidbg.php CHANGED
@@ -4,15 +4,13 @@ Plugin Name: Video Background
4
  Plugin URI: http://blakewilson.me/projects/video-background/
5
  Description: jQuery WordPress plugin to easily assign a video background to any element. Awesome.
6
  Author: Blake Wilson
7
- Version: 2.5.3
8
  Author URI: http://blakewilson.me
9
  Donate Link: http://paypal.me/blakewilsonme
10
  Text Domain: video-background
11
  Domain Path: /languages
12
  */
13
 
14
-
15
-
16
  /**
17
  * Include the metabox framework
18
  */
@@ -23,189 +21,289 @@ if ( file_exists( dirname( __FILE__ ) . '/framework/cmb2_field_slider.php' ) ) {
23
  require_once dirname( __FILE__ ) . '/framework/cmb2_field_slider.php';
24
  }
25
 
26
-
27
-
28
  /**
29
  * Install the plugin
30
  * deactivate vidbgpro if installed
 
 
 
 
 
 
31
  */
32
  function vidbg_install_plugin() {
33
  if( is_plugin_active( 'video-background-pro/vidbgpro.php') ) {
34
  deactivate_plugins( 'video-background-pro/vidbgpro.php' );
35
  }
36
  delete_option( 'vidbgpro-notice-dismissed' );
 
37
  }
38
  register_activation_hook( __FILE__, 'vidbg_install_plugin' );
39
 
40
-
41
-
42
  /**
43
  * Load plugin textdomain.
 
 
 
 
 
44
  */
45
  function vidbg_load_textdomain() {
46
- load_plugin_textdomain( 'video-background', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
47
  }
48
  add_action( 'plugins_loaded', 'vidbg_load_textdomain' );
49
 
50
-
51
-
52
  /**
53
  * Enqueue backend style and script
 
 
 
 
 
 
 
54
  */
55
  function vidbg_metabox_scripts() {
56
  wp_enqueue_style('vidbg-metabox-style', plugins_url('/css/vidbg-style.css', __FILE__));
57
- wp_enqueue_script( 'vidbg-admin-backend', plugin_dir_url( __FILE__ ) . '/js/vidbg-backend.js' );
 
 
 
 
 
58
  }
59
  add_action('admin_enqueue_scripts', 'vidbg_metabox_scripts');
60
 
61
-
62
-
63
  /**
64
  * Enqueue vidbg jquery script
 
 
 
 
 
65
  */
66
  function vidbg_jquery() {
67
- wp_enqueue_script('vidbg-video-background', plugins_url('/js/dist/vidbg.min.js', __FILE__), array('jquery'), '1.1', true);
68
  }
69
  add_action('wp_footer', 'vidbg_jquery' );
70
 
71
-
72
-
73
  /**
74
  * Add custom color palette
 
 
75
  */
76
  function vidbg_default_color_palette( $l10n ) {
77
- $l10n['defaults']['color_picker'] = array(
78
- 'palettes' => array( '#000000', '#3498db', '#e74c3c', '#374e64', '#2ecc71', '#f1c40f' ),
79
- );
80
- return $l10n;
81
  }
82
  add_filter( 'cmb2_localized_data', 'vidbg_default_color_palette' );
83
 
 
 
 
 
 
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
  /**
87
  * Register metabox and scripts
 
 
 
 
 
 
 
88
  */
89
  function vidbg_register_metabox() {
90
- $prefix = 'vidbg_metabox_field_';
91
-
92
- $vidbg_metabox = new_cmb2_box( array(
93
- 'id' => 'vidbg-metabox',
94
- 'title' => __( 'Video Background', 'video-background' ),
95
- 'object_types' => array( 'post', 'page' ),
96
- 'context' => 'normal',
97
- 'priority' => 'high',
98
- ) );
99
-
100
- $vidbg_metabox->add_field( array(
101
- 'name' => __( 'Container', 'video-background' ),
102
- 'desc' => __( 'Please specify the container you would like your video background to be in.<br>ex: <code>.header</code> or <code>body</code>', 'video-background' ),
103
- 'id' => $prefix . 'container',
104
- 'type' => 'text',
105
- ) );
106
-
107
- $vidbg_metabox->add_field( array(
108
- 'name' => __( 'Link to .mp4', 'video-background' ),
109
- 'desc' => __( 'Please specify the link to the .mp4 file. You can either enter a URL or upload a file.<br>For browser compatability, please enter an .mp4 and .webm file for video backgrounds.', 'video-background' ),
110
- 'id' => $prefix . 'mp4',
111
- 'type' => 'file',
112
- 'options' => array(
113
- 'add_upload_file_text' => __( 'Upload .mp4 file', 'video-background' ),
114
- ),
115
- ) );
116
-
117
- $vidbg_metabox->add_field( array(
118
- 'name' => __( 'Link to .webm', 'video-background' ),
119
- 'desc' => __( 'Please specify the link to the .webm file. You can either enter a URL or upload a file.<br>For browser compatability, please enter an .mp4 and .webm file for video backgrounds.', 'video-background' ),
120
- 'id' => $prefix . 'webm',
121
- 'type' => 'file',
122
- 'options' => array(
123
- 'add_upload_file_text' => __( 'Upload .webm file', 'video-background' ),
124
- ),
125
- ) );
126
-
127
- $vidbg_metabox->add_field( array(
128
- 'name' => __( 'Link to fallback image', 'video-background' ),
129
- 'desc' => __( 'Please specify a link to the fallback image in case the browser does not support video backgrounds. You can either enter a URL or upload a file.', 'video-background' ),
130
- 'id' => $prefix . 'poster',
131
- 'type' => 'file',
132
- 'options' => array(
133
- 'add_upload_file_text' => __( 'Upload fallback image', 'video-background' ),
134
- ),
135
- ) );
136
-
137
- $vidbg_metabox->add_field( array(
138
- 'name' => __( 'Overlay', 'video-background' ),
139
- 'desc' => __( 'Add an overlay over the video. This is useful if your text isn\'t readable with a video background.', 'video-background' ),
140
- 'id' => $prefix . 'overlay',
141
- 'type' => 'radio_inline',
142
- 'default' => 'off',
143
  'options' => array(
144
- 'off' => __( 'Off', 'video-background' ),
145
- 'on' => __( 'On', 'video-background' ),
 
 
 
 
 
 
 
 
 
 
 
146
  ),
147
  'before_row' => '<div id="vidbg_advanced_options">',
148
- ) );
149
-
150
- $vidbg_metabox->add_field( array(
151
- 'name' => __( 'Overlay Color', 'video-background' ),
152
- 'desc' => __( 'If overlay is enabled, a color will be used for the overlay. You can specify the color here.', 'video-background' ),
153
- 'id' => $prefix . 'overlay_color',
154
- 'type' => 'colorpicker',
155
- 'default' => '#000',
156
- ) );
157
-
158
- $vidbg_metabox->add_field( array(
159
- 'name' => __( 'Overlay Opacity', 'video-background' ),
160
- 'desc' => __( 'Specify the opacity of the overlay with the left being mostly transparent and the right being hardly transparent.', 'video-background' ),
161
- 'id' => $prefix . 'overlay_alpha',
162
- 'type' => 'own_slider',
163
- 'min' => '10',
164
- 'max' => '99',
165
  'default' => '30',
166
- ) );
 
 
 
 
 
 
167
 
168
- $vidbg_metabox->add_field( array(
169
- 'name' => __( 'Turn off loop?', 'video-background' ),
170
- 'desc' => __( 'Turn off the loop for Video Background. Once the video is complete, it will display the last frame of the video.', 'video-background' ),
171
- 'id' => $prefix . 'no_loop',
172
- 'type' => 'radio_inline',
173
  'default' => 'off',
174
  'options' => array(
175
- 'off' => __( 'Off', 'video-background' ),
176
- 'on' => __( 'On', 'video-background' ),
177
  ),
178
- ) );
179
 
180
- $vidbg_metabox->add_field( array(
181
- 'name' => __( 'Play the audio?', 'video-background' ),
182
- 'desc' => __( 'Enabling this will play the audio of the video.', 'video-background' ),
183
- 'id' => $prefix . 'unmute',
184
- 'type' => 'radio_inline',
185
- 'default' => 'off',
186
- 'options' => array(
187
- 'off' => __( 'Off', 'video-background' ),
188
- 'on' => __( 'On', 'video-background' ),
189
  ),
190
- 'after_row' => '</div>',
191
- ) );
 
 
 
 
 
 
 
 
 
 
192
 
193
  $vidbg_metabox->add_field( array(
194
- 'before_field' => '<a href="#vidbg_advanced_options" class="button vidbg-button advanced-options-button">Show Advanced options</a>',
195
- 'type' => 'title',
196
- 'id' => $prefix . 'advanced_button',
197
- ) );
198
 
199
  }
200
  add_action( 'cmb2_admin_init', 'vidbg_register_metabox' );
201
 
202
-
203
-
204
  /**
205
  * Add inline javascript to footer for video background
 
 
 
 
 
 
 
 
 
206
  */
207
  function vidbg_initialize_footer() {
208
- if( is_page() || is_single() || is_home() && get_option( 'show_on_front') == 'page' ) {
209
 
210
  if( is_page() || is_single() ) {
211
  $the_id = get_the_ID();
@@ -213,17 +311,17 @@ function vidbg_initialize_footer() {
213
  $the_id = get_option( 'page_for_posts' );
214
  }
215
 
216
- $container_field = get_post_meta( $the_id, 'vidbg_metabox_field_container', true );
217
- $mp4_field = get_post_meta( $the_id, 'vidbg_metabox_field_mp4', true );
218
- $webm_field = get_post_meta( $the_id, 'vidbg_metabox_field_webm', true );
219
- $poster_field = get_post_meta( $the_id, 'vidbg_metabox_field_poster', true );
220
- $overlay = get_post_meta( $the_id, 'vidbg_metabox_field_overlay', true );
221
  $overlay_color = get_post_meta( $the_id, 'vidbg_metabox_field_overlay_color', true );
222
  $overlay_alpha = get_post_meta( $the_id, 'vidbg_metabox_field_overlay_alpha', true );
223
- $no_loop_field = get_post_meta( $the_id, 'vidbg_metabox_field_no_loop', true );
224
- $unmute_field = get_post_meta( $the_id, 'vidbg_metabox_field_unmute', true );
225
 
226
- if( !empty( $container_field ) ): ?>
227
  <?php
228
  if( $unmute_field == 'on' ) {
229
  $boolean_mute = 'false';
@@ -246,8 +344,8 @@ function vidbg_initialize_footer() {
246
  $overlay_color_value = !empty($overlay_color) ? $overlay_color : '#000';
247
  $overlay_alpha_value = !empty($overlay_alpha) ? '0.' . $overlay_alpha : '0.3';
248
  ?>
249
- <script type="text/javascript">
250
- jQuery(function($){
251
  var vidbgContainerValue = '<?php echo $container_field; ?>';
252
  var vidbgMp4Value = '<?php echo $mp4_field; ?>';
253
  var vidbgWebmValue = '<?php echo $webm_field; ?>';
@@ -258,32 +356,35 @@ function vidbg_initialize_footer() {
258
  var vidbgOverlayColor = '<?php echo $overlay_color_value; ?>';
259
  var vidbgOverlayAlpha = '<?php echo $overlay_alpha_value; ?>';
260
 
261
- $(vidbgContainerValue).vidbg({
262
- 'mp4': vidbgMp4Value,
263
- 'webm': vidbgWebmValue,
264
- 'poster': vidbgPosterValue,
265
- }, {
266
  muted: vidbgIsMuted,
267
  loop: vidbgIsLoop,
268
  overlay: vidbgIsOverlay,
269
  overlayColor: vidbgOverlayColor,
270
  overlayAlpha: vidbgOverlayAlpha,
271
- });
272
- });
273
- </script>
274
- <?php endif;
275
 
276
- }
277
  }
278
  add_action( 'wp_footer', 'vidbg_initialize_footer' );
279
 
280
-
281
-
282
  /**
283
  * Shortcode for v1.0.x versions
 
 
 
 
 
284
  */
285
  function candide_video_background( $atts , $content = null ) {
286
- // Attributes
287
  extract(
288
  shortcode_atts(
289
  array(
@@ -300,10 +401,10 @@ function candide_video_background( $atts , $content = null ) {
300
  )
301
  );
302
 
303
- // Put It Together
304
- ob_start(); ?>
305
- <script>
306
- jQuery(function($){
307
  var vidbgContainerValue = '<?php echo $container; ?>';
308
  var vidbgMp4Value = '<?php echo $mp4; ?>';
309
  var vidbgWebmValue = '<?php echo $webm; ?>';
@@ -314,49 +415,110 @@ function candide_video_background( $atts , $content = null ) {
314
  var vidbgOverlayColor = '<?php echo $overlay_color; ?>';
315
  var vidbgOverlayAlpha = '<?php echo $overlay_alpha; ?>';
316
 
317
- $(vidbgContainerValue).vidbg({
318
- 'mp4': vidbgMp4Value,
319
- 'webm': vidbgWebmValue,
320
- 'poster': vidbgPosterValue,
321
  }, {
322
  muted: vidbgIsMuted,
323
  loop: vidbgIsLoop,
324
  overlay: vidbgIsOverlay,
325
  overlayColor: vidbgOverlayColor,
326
  overlayAlpha: vidbgOverlayAlpha,
327
- });
328
- });
329
- <?php
330
 
331
- $outputbefore = ob_get_clean();
332
- $outputafter = '</script>';
333
 
334
- //Return
335
 
336
- return $outputbefore . do_shortcode($content) . $outputafter;
337
  }
338
  add_shortcode( 'vidbg', 'candide_video_background' );
339
 
340
-
341
-
342
  /**
343
  * Add getting started page
 
 
 
 
344
  */
345
  function vidbg_add_gettingstarted() {
346
- add_options_page(
347
- 'Video Background',
348
- 'Video Background',
349
- 'manage_options',
350
- 'html5-vidbg',
351
- 'vidbg_gettingstarted_page'
352
- );
353
  }
354
  add_action( 'admin_menu', 'vidbg_add_gettingstarted' );
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  /**
359
  * Getting started page content
 
 
 
 
 
 
 
360
  */
361
  function vidbg_gettingstarted_page() {
362
  echo '<div class="wrap">';
@@ -374,8 +536,8 @@ function vidbg_gettingstarted_page() {
374
  _e( '<a href="http://blakewilson.me/projects/video-background/" class="button" target="_blank">Further Documentation</a>', 'video-background' );
375
  _e( '<h3>Questions?</h3>', 'video-background' );
376
  _e( '<p>If you have any feedback/questions regarding the plugin you can reach me <a href="https://wordpress.org/support/plugin/video-background" target="_blank">here.</a>', 'video-background' );
377
- _e( '<h3>Support</h3>', 'video-background' );
378
- _e( '<p>If you like Video Background and want to show your support, consider purchasing the <a href="http://pushlabs.co/video-background-pro" target="_blank">pro version</a>. It comes with plenty of helpful features that make your life easier like:</p>', 'video-background' );
379
  echo '<ul>';
380
  _e( '<li>YouTube Integration</li>', 'video-background' );
381
  _e( '<li>Visual Composer Integration</li>', 'video-background' );
@@ -387,43 +549,45 @@ function vidbg_gettingstarted_page() {
387
  _e( '<li>Video Tutorials</li>', 'video-background' );
388
  _e( '<li>And Much More!</li>', 'video-background' );
389
  echo '</ul>';
390
- _e( '<a href="http://pushlabs.co/video-background-pro" class="button button-primary" target="_blank">Purchase Video Background Pro</a>', 'video-background' );
391
  _e( ' <a href="https://twitter.com/intent/follow?screen_name=blakewilsonme" class="button button-primary vidbg-twitter" target="_blank">Get Updates on Twitter</a>', 'video-background' );
 
 
 
 
 
392
  echo '</div>';
393
  }
394
 
395
-
396
-
397
  /**
398
  * Add getting started link on plugin page
 
 
 
 
399
  */
400
  function vidbg_gettingstarted_link($links) {
401
- $gettingstarted_link = '<a href="options-general.php?page=html5-vidbg">Getting Started</a>';
402
- array_unshift($links, $gettingstarted_link);
403
- return $links;
404
  }
405
- $plugin = plugin_basename(__FILE__);
406
- add_filter("plugin_action_links_$plugin", 'vidbg_gettingstarted_link' );
407
-
408
-
409
 
410
  /**
411
  * Create function to see if WordPress version is 4.2 or higher
 
 
412
  */
413
- if ( ! function_exists( 'vidbg_is_wp_version' ) ) {
414
- function vidbg_is_wp_version( $version = '4.2' ) {
415
- global $wp_version;
416
 
417
- if ( version_compare( $wp_version, $version, '>=' ) ) {
418
- return true;
419
- } else {
420
- return false;
421
- }
422
  }
423
  }
424
 
425
-
426
-
427
  /**
428
  * If WP version is 4.2 or higher display premium notice message
429
  */
4
  Plugin URI: http://blakewilson.me/projects/video-background/
5
  Description: jQuery WordPress plugin to easily assign a video background to any element. Awesome.
6
  Author: Blake Wilson
7
+ Version: 2.5.4
8
  Author URI: http://blakewilson.me
9
  Donate Link: http://paypal.me/blakewilsonme
10
  Text Domain: video-background
11
  Domain Path: /languages
12
  */
13
 
 
 
14
  /**
15
  * Include the metabox framework
16
  */
21
  require_once dirname( __FILE__ ) . '/framework/cmb2_field_slider.php';
22
  }
23
 
 
 
24
  /**
25
  * Install the plugin
26
  * deactivate vidbgpro if installed
27
+ *
28
+ * @since 2.5.2
29
+ *
30
+ * @uses is_plugin_active()
31
+ * @uses deactivate_plugins()
32
+ * @uses delete_option()
33
  */
34
  function vidbg_install_plugin() {
35
  if( is_plugin_active( 'video-background-pro/vidbgpro.php') ) {
36
  deactivate_plugins( 'video-background-pro/vidbgpro.php' );
37
  }
38
  delete_option( 'vidbgpro-notice-dismissed' );
39
+ delete_option( 'vidbg_disable_pro_fields' );
40
  }
41
  register_activation_hook( __FILE__, 'vidbg_install_plugin' );
42
 
 
 
43
  /**
44
  * Load plugin textdomain.
45
+ *
46
+ * @since 2.5.0
47
+ *
48
+ * @uses load_plugin_textdomain()
49
+ * @uses plugin_basename()
50
  */
51
  function vidbg_load_textdomain() {
52
+ load_plugin_textdomain( 'video-background', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
53
  }
54
  add_action( 'plugins_loaded', 'vidbg_load_textdomain' );
55
 
 
 
56
  /**
57
  * Enqueue backend style and script
58
+ *
59
+ * @since 2.1.4
60
+ *
61
+ * @uses wp_enqueue_style()
62
+ * @uses plugins_url()
63
+ * @uses wp_enqueue_script()
64
+ * @uses plugin_dir_url()
65
  */
66
  function vidbg_metabox_scripts() {
67
  wp_enqueue_style('vidbg-metabox-style', plugins_url('/css/vidbg-style.css', __FILE__));
68
+ wp_enqueue_script( 'vidbg-admin-backend', plugin_dir_url( __FILE__ ) . '/js/vidbg-backend.js' );
69
+
70
+ wp_localize_script( 'vidbg-admin-backend', 'vidbg_localized_text', array(
71
+ 'show_advanced' => __( 'Show Advanced Options', 'video-background' ),
72
+ 'hide_advanced' => __( 'Hide Advanced Options', 'video-background' ),
73
+ ) );
74
  }
75
  add_action('admin_enqueue_scripts', 'vidbg_metabox_scripts');
76
 
 
 
77
  /**
78
  * Enqueue vidbg jquery script
79
+ *
80
+ * @since 2.0.0
81
+ *
82
+ * @uses wp_enqueue_script()
83
+ * @uses plugins_url()
84
  */
85
  function vidbg_jquery() {
86
+ wp_enqueue_script('vidbg-video-background', plugins_url('/js/dist/vidbg.min.js', __FILE__), array('jquery'), '1.1', true);
87
  }
88
  add_action('wp_footer', 'vidbg_jquery' );
89
 
 
 
90
  /**
91
  * Add custom color palette
92
+ *
93
+ * @since 2.5.0
94
  */
95
  function vidbg_default_color_palette( $l10n ) {
96
+ $l10n['defaults']['color_picker'] = array(
97
+ 'palettes' => array( '#000000', '#3498db', '#e74c3c', '#374e64', '#2ecc71', '#f1c40f' ),
98
+ );
99
+ return $l10n;
100
  }
101
  add_filter( 'cmb2_localized_data', 'vidbg_default_color_palette' );
102
 
103
+ /**
104
+ * Helper function to output disabled Video Background Pro fields
105
+ *
106
+ * @since 2.5.4
107
+ */
108
+ function vidbg_disabled_pro_field( $field_name = 'Blank Pro', $field_id = 'pro_blank', $field_type = 'input', $field_description = '' ) {
109
 
110
+ $output = '';
111
+ $options = get_option( 'vidbg_disable_pro_fields' );
112
+
113
+ if ( $options['vidbg_checkbox_disable_pro_field'] !== '1' ) {
114
+ if ( $field_type === 'input' ) {
115
+ $field_class = 'cmb-row cmb-type-text cmb2-id-pro-disabled-field-' . $field_id . ' table-layout';
116
+ } elseif ( $field_type === 'radio' ) {
117
+ $field_class = 'cmb-row cmb-type-radio-inline cmb2-id-pro-disabled-field-' . $field_id . ' cmb-inline';
118
+ }
119
+
120
+ $output .= '<div class="' . $field_class . '">';
121
+ $output .= '<div class="cmb-th"><label for="pro_disabled_' . $field_id . '">' . $field_name . '</label></div>';
122
+ $output .= '<div class="cmb-td">';
123
+
124
+ if ( $field_type === 'input' ) {
125
+ $output .= '<input type="text" class="regular-text" name="pro_disabled_' . $field_id . '" id="' . $field_id . '" disabled>';
126
+ }
127
+
128
+ if ( $field_type === 'radio' ) {
129
+ $output .= '<ul class="cmb2-radio-list cmb2-list">';
130
+ $output .= '<li><input type="radio" value="off" class="cmb2-option" name="pro_disabled_' . $field_id . '" id="pro_disabled_' . $field_id . '1" checked="checked" disabled> <label for="pro_disabled_' . $field_id . '1">Off</label></li>';
131
+ $output .= '<li><input type="radio" class="cmb2-option" name="pro_disabled_' . $field_id . '" id="pro_disabled_' . $field_id . '2" value="on" disabled> <label for="pro_disabled_' . $field_id . '2">On</label></li>';
132
+ $output .= '</ul>';
133
+ }
134
+
135
+ if ( $field_id === 'overlay_texture' ) {
136
+ $output .= '<input class="cmb2-upload-button button" type="button" value="Upload Overlay Texture" disabled="">';
137
+ }
138
+
139
+ $output .= '<p class="cmb2-metabox-description">' . $field_description . '</p>';
140
+ $output .= '</div>';
141
+ $output .= '</div>';
142
+ }
143
+
144
+ return $output;
145
+ }
146
 
147
  /**
148
  * Register metabox and scripts
149
+ *
150
+ * @since 2.5.0
151
+ *
152
+ * @uses new_cmb2_box()
153
+ * @uses __()
154
+ * @uses add_field()
155
+ * @uses vidbg_disabled_pro_field()
156
  */
157
  function vidbg_register_metabox() {
158
+ $prefix = 'vidbg_metabox_field_';
159
+ $post_types = array( 'post', 'page' );
160
+
161
+ $vidbg_metabox = new_cmb2_box( array(
162
+ 'id' => 'vidbg-metabox',
163
+ 'title' => __( 'Video Background', 'video-background' ),
164
+ 'object_types' => $post_types,
165
+ 'context' => 'normal',
166
+ 'priority' => 'high',
167
+ ) );
168
+
169
+ $vidbg_metabox->add_field( array(
170
+ 'name' => __( 'Container', 'video-background' ),
171
+ 'desc' => __( 'Please specify the container you would like your video background to be in.<br>ex: <code>.header</code> or <code>body</code>', 'video-background' ),
172
+ 'id' => $prefix . 'container',
173
+ 'type' => 'text',
174
+ 'after_row' => vidbg_disabled_pro_field(
175
+ __( 'YouTube Link', 'video-background' ),
176
+ 'youtube_link',
177
+ 'input',
178
+ __( 'To create YouTube video backgrounds, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
179
+ ),
180
+ ) );
181
+
182
+ $vidbg_metabox->add_field( array(
183
+ 'name' => __( 'Link to .mp4', 'video-background' ),
184
+ 'desc' => __( 'Please specify the link to the .mp4 file. You can either enter a URL or upload a file.<br>For browser compatability, please enter an .mp4 and .webm file for video backgrounds.', 'video-background' ),
185
+ 'id' => $prefix . 'mp4',
186
+ 'type' => 'file',
187
+ 'options' => array(
188
+ 'add_upload_file_text' => __( 'Upload .mp4 file', 'video-background' ),
189
+ ),
190
+ ) );
191
+
192
+ $vidbg_metabox->add_field( array(
193
+ 'name' => __( 'Link to .webm', 'video-background' ),
194
+ 'desc' => __( 'Please specify the link to the .webm file. You can either enter a URL or upload a file.<br>For browser compatability, please enter an .mp4 and .webm file for video backgrounds.', 'video-background' ),
195
+ 'id' => $prefix . 'webm',
196
+ 'type' => 'file',
197
+ 'options' => array(
198
+ 'add_upload_file_text' => __( 'Upload .webm file', 'video-background' ),
199
+ ),
200
+ ) );
201
+
202
+ $vidbg_metabox->add_field( array(
203
+ 'name' => __( 'Link to fallback image', 'video-background' ),
204
+ 'desc' => __( 'Please specify a link to the fallback image in case the browser does not support video backgrounds. You can either enter a URL or upload a file.', 'video-background' ),
205
+ 'id' => $prefix . 'poster',
206
+ 'type' => 'file',
 
 
 
 
207
  'options' => array(
208
+ 'add_upload_file_text' => __( 'Upload fallback image', 'video-background' ),
209
+ ),
210
+ ) );
211
+
212
+ $vidbg_metabox->add_field( array(
213
+ 'name' => __( 'Overlay', 'video-background' ),
214
+ 'desc' => __( 'Add an overlay over the video. This is useful if your text isn\'t readable with a video background.', 'video-background' ),
215
+ 'id' => $prefix . 'overlay',
216
+ 'type' => 'radio_inline',
217
+ 'default' => 'off',
218
+ 'options' => array(
219
+ 'off' => __( 'Off', 'video-background' ),
220
+ 'on' => __( 'On', 'video-background' ),
221
  ),
222
  'before_row' => '<div id="vidbg_advanced_options">',
223
+ ) );
224
+
225
+ $vidbg_metabox->add_field( array(
226
+ 'name' => __( 'Overlay Color', 'video-background' ),
227
+ 'desc' => __( 'If overlay is enabled, a color will be used for the overlay. You can specify the color here.', 'video-background' ),
228
+ 'id' => $prefix . 'overlay_color',
229
+ 'type' => 'colorpicker',
230
+ 'default' => '#000',
231
+ ) );
232
+
233
+ $vidbg_metabox->add_field( array(
234
+ 'name' => __( 'Overlay Opacity', 'video-background' ),
235
+ 'desc' => __( 'Specify the opacity of the overlay with the left being mostly transparent and the right being hardly transparent.', 'video-background' ),
236
+ 'id' => $prefix . 'overlay_alpha',
237
+ 'type' => 'own_slider',
238
+ 'min' => '10',
239
+ 'max' => '99',
240
  'default' => '30',
241
+ 'after_row' => vidbg_disabled_pro_field(
242
+ __( 'Overlay Texture', 'video-background' ),
243
+ 'overlay_texture',
244
+ 'input',
245
+ __( 'To add overlay textures to your video background, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
246
+ ),
247
+ ) );
248
 
249
+ $vidbg_metabox->add_field( array(
250
+ 'name' => __( 'Turn off loop?', 'video-background' ),
251
+ 'desc' => __( 'Turn off the loop for Video Background. Once the video is complete, it will display the last frame of the video.', 'video-background' ),
252
+ 'id' => $prefix . 'no_loop',
253
+ 'type' => 'radio_inline',
254
  'default' => 'off',
255
  'options' => array(
256
+ 'off' => __( 'Off', 'video-background' ),
257
+ 'on' => __( 'On', 'video-background' ),
258
  ),
259
+ ) );
260
 
261
+ $vidbg_metabox->add_field( array(
262
+ 'name' => __( 'Play the audio?', 'video-background' ),
263
+ 'desc' => __( 'Enabling this will play the audio of the video.', 'video-background' ),
264
+ 'id' => $prefix . 'unmute',
265
+ 'type' => 'radio_inline',
266
+ 'default' => 'off',
267
+ 'options' => array(
268
+ 'off' => __( 'Off', 'video-background' ),
269
+ 'on' => __( 'On', 'video-background' ),
270
  ),
271
+ 'after_row' => vidbg_disabled_pro_field(
272
+ __( 'Enable Play/Pause button', 'video-background' ),
273
+ 'play_button',
274
+ 'radio',
275
+ __( 'To enable a play/pause button on the frontend, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
276
+ ) . vidbg_disabled_pro_field(
277
+ __( 'Enable Mute/Unmute button', 'video-background' ),
278
+ 'volume_button',
279
+ 'radio',
280
+ __( 'To enable a mute/unmute button on the frontend, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
281
+ ) . '</div>',
282
+ ) );
283
 
284
  $vidbg_metabox->add_field( array(
285
+ 'before_field' => __( '<a href="#vidbg_advanced_options" class="button vidbg-button advanced-options-button">Show Advanced options</a>', 'video-background' ),
286
+ 'type' => 'title',
287
+ 'id' => $prefix . 'advanced_button',
288
+ ) );
289
 
290
  }
291
  add_action( 'cmb2_admin_init', 'vidbg_register_metabox' );
292
 
 
 
293
  /**
294
  * Add inline javascript to footer for video background
295
+ *
296
+ * @since 2.0.0
297
+ *
298
+ * @uses is_page()
299
+ * @uses is_single()
300
+ * @uses is_home()
301
+ * @uses get_option()
302
+ * @uses get_the_ID()
303
+ * @uses get_post_meta()
304
  */
305
  function vidbg_initialize_footer() {
306
+ if( is_page() || is_single() || is_home() && get_option( 'show_on_front') == 'page' ) {
307
 
308
  if( is_page() || is_single() ) {
309
  $the_id = get_the_ID();
311
  $the_id = get_option( 'page_for_posts' );
312
  }
313
 
314
+ $container_field = get_post_meta( $the_id, 'vidbg_metabox_field_container', true );
315
+ $mp4_field = get_post_meta( $the_id, 'vidbg_metabox_field_mp4', true );
316
+ $webm_field = get_post_meta( $the_id, 'vidbg_metabox_field_webm', true );
317
+ $poster_field = get_post_meta( $the_id, 'vidbg_metabox_field_poster', true );
318
+ $overlay = get_post_meta( $the_id, 'vidbg_metabox_field_overlay', true );
319
  $overlay_color = get_post_meta( $the_id, 'vidbg_metabox_field_overlay_color', true );
320
  $overlay_alpha = get_post_meta( $the_id, 'vidbg_metabox_field_overlay_alpha', true );
321
+ $no_loop_field = get_post_meta( $the_id, 'vidbg_metabox_field_no_loop', true );
322
+ $unmute_field = get_post_meta( $the_id, 'vidbg_metabox_field_unmute', true );
323
 
324
+ if( !empty( $container_field ) ): ?>
325
  <?php
326
  if( $unmute_field == 'on' ) {
327
  $boolean_mute = 'false';
344
  $overlay_color_value = !empty($overlay_color) ? $overlay_color : '#000';
345
  $overlay_alpha_value = !empty($overlay_alpha) ? '0.' . $overlay_alpha : '0.3';
346
  ?>
347
+ <script type="text/javascript">
348
+ jQuery(function($){
349
  var vidbgContainerValue = '<?php echo $container_field; ?>';
350
  var vidbgMp4Value = '<?php echo $mp4_field; ?>';
351
  var vidbgWebmValue = '<?php echo $webm_field; ?>';
356
  var vidbgOverlayColor = '<?php echo $overlay_color_value; ?>';
357
  var vidbgOverlayAlpha = '<?php echo $overlay_alpha_value; ?>';
358
 
359
+ $(vidbgContainerValue).vidbg({
360
+ 'mp4': vidbgMp4Value,
361
+ 'webm': vidbgWebmValue,
362
+ 'poster': vidbgPosterValue,
363
+ }, {
364
  muted: vidbgIsMuted,
365
  loop: vidbgIsLoop,
366
  overlay: vidbgIsOverlay,
367
  overlayColor: vidbgOverlayColor,
368
  overlayAlpha: vidbgOverlayAlpha,
369
+ });
370
+ });
371
+ </script>
372
+ <?php endif;
373
 
374
+ }
375
  }
376
  add_action( 'wp_footer', 'vidbg_initialize_footer' );
377
 
 
 
378
  /**
379
  * Shortcode for v1.0.x versions
380
+ *
381
+ * @since 1.0.0
382
+ *
383
+ * @uses shortcode_atts()
384
+ * @uses do_shortcode()
385
  */
386
  function candide_video_background( $atts , $content = null ) {
387
+ // Attributes
388
  extract(
389
  shortcode_atts(
390
  array(
401
  )
402
  );
403
 
404
+ // Put It Together
405
+ ob_start(); ?>
406
+ <script>
407
+ jQuery(function($){
408
  var vidbgContainerValue = '<?php echo $container; ?>';
409
  var vidbgMp4Value = '<?php echo $mp4; ?>';
410
  var vidbgWebmValue = '<?php echo $webm; ?>';
415
  var vidbgOverlayColor = '<?php echo $overlay_color; ?>';
416
  var vidbgOverlayAlpha = '<?php echo $overlay_alpha; ?>';
417
 
418
+ $(vidbgContainerValue).vidbg({
419
+ 'mp4': vidbgMp4Value,
420
+ 'webm': vidbgWebmValue,
421
+ 'poster': vidbgPosterValue,
422
  }, {
423
  muted: vidbgIsMuted,
424
  loop: vidbgIsLoop,
425
  overlay: vidbgIsOverlay,
426
  overlayColor: vidbgOverlayColor,
427
  overlayAlpha: vidbgOverlayAlpha,
428
+ });
429
+ });
430
+ <?php
431
 
432
+ $outputbefore = ob_get_clean();
433
+ $outputafter = '</script>';
434
 
435
+ //Return
436
 
437
+ return $outputbefore . do_shortcode($content) . $outputafter;
438
  }
439
  add_shortcode( 'vidbg', 'candide_video_background' );
440
 
 
 
441
  /**
442
  * Add getting started page
443
+ *
444
+ * @since 2.1.1
445
+ *
446
+ * @uses add_options_page()
447
  */
448
  function vidbg_add_gettingstarted() {
449
+ add_options_page(
450
+ 'Video Background',
451
+ 'Video Background',
452
+ 'manage_options',
453
+ 'html5-vidbg',
454
+ 'vidbg_gettingstarted_page'
455
+ );
456
  }
457
  add_action( 'admin_menu', 'vidbg_add_gettingstarted' );
458
 
459
+ /**
460
+ * Creates Video Background plugin settings
461
+ *
462
+ * @since 2.5.4
463
+ *
464
+ * @uses register_setting()
465
+ * @uses add_settings_section()
466
+ * @uses add_settings_field()
467
+ */
468
+ function vidbg_register_settings() {
469
+ register_setting( 'vidbg_settings', 'vidbg_disable_pro_fields' );
470
+
471
+ add_settings_section(
472
+ 'vidbg_vidbg_settings_section',
473
+ __( 'Hide Muted Pro Fields', 'video-background' ),
474
+ 'vidbg_disable_pro_fields_section_callback',
475
+ 'vidbg_settings'
476
+ );
477
 
478
+ add_settings_field(
479
+ 'vidbg_checkbox_disable_pro_field',
480
+ __( 'Hide Muted Pro Fields', 'video-background' ),
481
+ 'vidbg_checkbox_disable_pro_field_render',
482
+ 'vidbg_settings',
483
+ 'vidbg_vidbg_settings_section'
484
+ );
485
+ }
486
+ add_action( 'admin_init', 'vidbg_register_settings' );
487
+
488
+ /**
489
+ * Creats the checkbox callback for Video Background options
490
+ *
491
+ * @since 2.5.4
492
+ *
493
+ * @uses get_option()
494
+ */
495
+ function vidbg_checkbox_disable_pro_field_render() {
496
+ $options = get_option( 'vidbg_disable_pro_fields' );
497
+ ?>
498
+ <input type='checkbox' name='vidbg_disable_pro_fields[vidbg_checkbox_disable_pro_field]' <?php checked( $options['vidbg_checkbox_disable_pro_field'], 1 ); ?> value='1'>
499
+ <?php
500
+ }
501
+
502
+ /**
503
+ * Video Background plugin settings section callback
504
+ *
505
+ * @since 2.5.4
506
+ *
507
+ * @uses _e()
508
+ */
509
+ function vidbg_disable_pro_fields_section_callback() {
510
+ _e( 'Okay, Okay, some of you don\'t want/need Video Background Pro. I get that. That\'s why you can hide the muted pro fields below :)', 'video-background' );
511
+ }
512
 
513
  /**
514
  * Getting started page content
515
+ *
516
+ * @since 2.1.1
517
+ *
518
+ * @uses _e()
519
+ * @uses settings_fields()
520
+ * @uses do_settings_sections()
521
+ * @uses submit_button()
522
  */
523
  function vidbg_gettingstarted_page() {
524
  echo '<div class="wrap">';
536
  _e( '<a href="http://blakewilson.me/projects/video-background/" class="button" target="_blank">Further Documentation</a>', 'video-background' );
537
  _e( '<h3>Questions?</h3>', 'video-background' );
538
  _e( '<p>If you have any feedback/questions regarding the plugin you can reach me <a href="https://wordpress.org/support/plugin/video-background" target="_blank">here.</a>', 'video-background' );
539
+ _e( '<h3>Supporting the Plugin</h3>', 'video-background' );
540
+ _e( '<p>If you like Video Background and want to show your support, consider purchasing the <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">pro version</a>. It comes with plenty of helpful features that make your life easier like:</p>', 'video-background' );
541
  echo '<ul>';
542
  _e( '<li>YouTube Integration</li>', 'video-background' );
543
  _e( '<li>Visual Composer Integration</li>', 'video-background' );
549
  _e( '<li>Video Tutorials</li>', 'video-background' );
550
  _e( '<li>And Much More!</li>', 'video-background' );
551
  echo '</ul>';
552
+ _e( '<a href="http://pushlabs.co/video-background-pro" class="button button-primary" rel="nofollow" target="_blank">Learn More About Video Background Pro</a>', 'video-background' );
553
  _e( ' <a href="https://twitter.com/intent/follow?screen_name=blakewilsonme" class="button button-primary vidbg-twitter" target="_blank">Get Updates on Twitter</a>', 'video-background' );
554
+ echo '<form action="options.php" method="post">';
555
+ settings_fields( 'vidbg_settings' );
556
+ do_settings_sections( 'vidbg_settings' );
557
+ submit_button();
558
+ echo '</form>';
559
  echo '</div>';
560
  }
561
 
 
 
562
  /**
563
  * Add getting started link on plugin page
564
+ *
565
+ * @since 2.1.1
566
+ *
567
+ * @uses __()
568
  */
569
  function vidbg_gettingstarted_link($links) {
570
+ $gettingstarted_link = __( '<a href="options-general.php?page=html5-vidbg">Getting Started</a>', 'video-background' );
571
+ array_unshift($links, $gettingstarted_link);
572
+ return $links;
573
  }
574
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'vidbg_gettingstarted_link' );
 
 
 
575
 
576
  /**
577
  * Create function to see if WordPress version is 4.2 or higher
578
+ *
579
+ * @since 2.5.1
580
  */
581
+ function vidbg_is_wp_version( $version = '4.2' ) {
582
+ global $wp_version;
 
583
 
584
+ if ( version_compare( $wp_version, $version, '>=' ) ) {
585
+ return true;
586
+ } else {
587
+ return false;
 
588
  }
589
  }
590
 
 
 
591
  /**
592
  * If WP version is 4.2 or higher display premium notice message
593
  */
css/vidbg-style.css CHANGED
@@ -26,6 +26,26 @@
26
  display: none;
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  .postbox-container .cmb2-wrap>.cmb-field-list>.cmb-row.cmb2-id-vidbg-metabox-field-advanced-button {
30
  border-top: 1px solid #e9e9e9;
31
  padding: 1.8em 0 1.8em 0;
26
  display: none;
27
  }
28
 
29
+ /* Muted pro fields */
30
+ .cmb-row input.disabled,
31
+ .cmb-row input:disabled,
32
+ .cmb-row select.disabled,
33
+ .cmb-row select:disabled,
34
+ .cmb-row textarea.disabled,
35
+ .cmb-row textarea:disabled {
36
+ background: #f8f8f8;
37
+ }
38
+ .cmb-row input[type=radio].disabled,
39
+ .cmb-row input[type=radio].disabled:checked:before,
40
+ .cmb-row input[type=radio]:disabled,
41
+ .cmb-row input[type=radio]:disabled:checked:before,
42
+ .cmb-row input[type=checkbox].disabled,
43
+ .cmb-row input[type=checkbox].disabled:checked:before,
44
+ .cmb-row input[type=checkbox]:disabled,
45
+ .cmb-row input[type=checkbox]:disabled:checked:before {
46
+ opacity: .5;
47
+ }
48
+
49
  .postbox-container .cmb2-wrap>.cmb-field-list>.cmb-row.cmb2-id-vidbg-metabox-field-advanced-button {
50
  border-top: 1px solid #e9e9e9;
51
  padding: 1.8em 0 1.8em 0;
js/vidbg-backend.js CHANGED
@@ -3,12 +3,14 @@ jQuery( document ).ready(function($) {
3
  // show advanced options on click
4
  $(function() {
5
  $('#vidbg_advanced_options').hide();
6
- $(".cmb2-id-vidbg-metabox-field-advanced-button a").click(function() {
 
7
  if ($('#vidbg_advanced_options').css('display') === 'none') {
8
  $('#vidbg_advanced_options').show(500);
9
- $('a.advanced-options-button').text('Hide Advanced Options');
10
  } else {
11
  $('#vidbg_advanced_options').hide(500);
 
12
  }
13
  });
14
  });
@@ -17,10 +19,10 @@ jQuery( document ).ready(function($) {
17
  $(function(){
18
  $('#vidbg_metabox_field_overlay1, #vidbg_metabox_field_overlay2').bind('change', function (e) {
19
  if( $('#vidbg_metabox_field_overlay1').is(':checked')) {
20
- $('.cmb2-id-vidbg-metabox-field-overlay-color, .cmb2-id-vidbg-metabox-field-overlay-alpha').hide(500);
21
  }
22
  else if( $('#vidbg_metabox_field_overlay2').is(':checked')) {
23
- $('.cmb2-id-vidbg-metabox-field-overlay-color, .cmb2-id-vidbg-metabox-field-overlay-alpha').show(500);
24
  }
25
  }).trigger('change');
26
  });
3
  // show advanced options on click
4
  $(function() {
5
  $('#vidbg_advanced_options').hide();
6
+ $(".cmb2-id-vidbg-metabox-field-advanced-button a").click(function(e) {
7
+ e.preventDefault();
8
  if ($('#vidbg_advanced_options').css('display') === 'none') {
9
  $('#vidbg_advanced_options').show(500);
10
+ $('a.advanced-options-button').text(vidbg_localized_text.hide_advanced);
11
  } else {
12
  $('#vidbg_advanced_options').hide(500);
13
+ $('a.advanced-options-button').text(vidbg_localized_text.show_advanced);
14
  }
15
  });
16
  });
19
  $(function(){
20
  $('#vidbg_metabox_field_overlay1, #vidbg_metabox_field_overlay2').bind('change', function (e) {
21
  if( $('#vidbg_metabox_field_overlay1').is(':checked')) {
22
+ $('.cmb2-id-vidbg-metabox-field-overlay-color, .cmb2-id-vidbg-metabox-field-overlay-alpha, .cmb2-id-pro-disabled-field-overlay_texture').hide(500);
23
  }
24
  else if( $('#vidbg_metabox_field_overlay2').is(':checked')) {
25
+ $('.cmb2-id-vidbg-metabox-field-overlay-color, .cmb2-id-vidbg-metabox-field-overlay-alpha, .cmb2-id-pro-disabled-field-overlay_texture').show(500);
26
  }
27
  }).trigger('change');
28
  });
languages/video-background.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Video Background\n"
6
- "POT-Creation-Date: 2016-06-05 23:01-0700\n"
7
  "PO-Revision-Date: 2016-03-30 22:31-0700\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
@@ -20,250 +20,324 @@ msgstr ""
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
- #: admin_premium_notice.php:7
24
  msgid ""
25
- "Youtube, Visual Composer, and SiteOrigin Integration with much more in the "
26
- "new Video Background Pro! <a href=\"http://pushlabs.co/video-background-pro"
27
- "\" target=\"_blank\">Learn more &raquo;</a>"
 
 
 
 
 
 
 
 
 
28
  msgstr ""
29
 
30
  #. Plugin Name of the plugin/theme
31
- #: candide-vidbg.php:94
32
  msgid "Video Background"
33
  msgstr ""
34
 
35
- #: candide-vidbg.php:101
36
  msgid "Container"
37
  msgstr ""
38
 
39
- #: candide-vidbg.php:102
40
  msgid ""
41
  "Please specify the container you would like your video background to be in."
42
  "<br>ex: <code>.header</code> or <code>body</code>"
43
  msgstr ""
44
 
45
- #: candide-vidbg.php:108
 
 
 
 
 
 
 
 
 
 
 
46
  msgid "Link to .mp4"
47
  msgstr ""
48
 
49
- #: candide-vidbg.php:109
50
  msgid ""
51
  "Please specify the link to the .mp4 file. You can either enter a URL or "
52
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
53
  "file for video backgrounds."
54
  msgstr ""
55
 
56
- #: candide-vidbg.php:113
57
  msgid "Upload .mp4 file"
58
  msgstr ""
59
 
60
- #: candide-vidbg.php:118
61
  msgid "Link to .webm"
62
  msgstr ""
63
 
64
- #: candide-vidbg.php:119
65
  msgid ""
66
  "Please specify the link to the .webm file. You can either enter a URL or "
67
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
68
  "file for video backgrounds."
69
  msgstr ""
70
 
71
- #: candide-vidbg.php:123
72
  msgid "Upload .webm file"
73
  msgstr ""
74
 
75
- #: candide-vidbg.php:128
76
  msgid "Link to fallback image"
77
  msgstr ""
78
 
79
- #: candide-vidbg.php:129
80
  msgid ""
81
  "Please specify a link to the fallback image in case the browser does not "
82
  "support video backgrounds. You can either enter a URL or upload a file."
83
  msgstr ""
84
 
85
- #: candide-vidbg.php:133
86
  msgid "Upload fallback image"
87
  msgstr ""
88
 
89
- #: candide-vidbg.php:138
90
  msgid "Overlay"
91
  msgstr ""
92
 
93
- #: candide-vidbg.php:139
94
  msgid ""
95
  "Add an overlay over the video. This is useful if your text isn't readable "
96
  "with a video background."
97
  msgstr ""
98
 
99
- #: candide-vidbg.php:144 candide-vidbg.php:175 candide-vidbg.php:187
100
  msgid "Off"
101
  msgstr ""
102
 
103
- #: candide-vidbg.php:145 candide-vidbg.php:176 candide-vidbg.php:188
104
  msgid "On"
105
  msgstr ""
106
 
107
- #: candide-vidbg.php:151
108
  msgid "Overlay Color"
109
  msgstr ""
110
 
111
- #: candide-vidbg.php:152
112
  msgid ""
113
  "If overlay is enabled, a color will be used for the overlay. You can specify "
114
  "the color here."
115
  msgstr ""
116
 
117
- #: candide-vidbg.php:159
118
  msgid "Overlay Opacity"
119
  msgstr ""
120
 
121
- #: candide-vidbg.php:160
122
  msgid ""
123
  "Specify the opacity of the overlay with the left being mostly transparent "
124
  "and the right being hardly transparent."
125
  msgstr ""
126
 
127
- #: candide-vidbg.php:169
 
 
 
 
 
 
 
 
 
 
 
128
  msgid "Turn off loop?"
129
  msgstr ""
130
 
131
- #: candide-vidbg.php:170
132
  msgid ""
133
  "Turn off the loop for Video Background. Once the video is complete, it will "
134
  "display the last frame of the video."
135
  msgstr ""
136
 
137
- #: candide-vidbg.php:181
138
  msgid "Play the audio?"
139
  msgstr ""
140
 
141
- #: candide-vidbg.php:182
142
  msgid "Enabling this will play the audio of the video."
143
  msgstr ""
144
 
145
- #: candide-vidbg.php:363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  msgid "<h2>Video Background</h2>"
147
  msgstr ""
148
 
149
- #: candide-vidbg.php:364
150
  msgid ""
151
  "<p>Video background makes it easy to add responsive, great looking video "
152
  "backgrounds to any element on your website.</p>"
153
  msgstr ""
154
 
155
- #: candide-vidbg.php:365
156
  msgid "<h3>Getting Started</h3>"
157
  msgstr ""
158
 
159
- #: candide-vidbg.php:366
160
  msgid ""
161
  "<p>To implement Video Background on your website, please follow the "
162
  "instructions below."
163
  msgstr ""
164
 
165
- #: candide-vidbg.php:368
166
  msgid ""
167
  "<li>Edit the page or post you would like the video background to appear on.</"
168
  "li>"
169
  msgstr ""
170
 
171
- #: candide-vidbg.php:369
172
  msgid ""
173
  "<li>Below the content editor, you should see a metabox titled <b>Video "
174
  "Background</b>. Enter the values for the required fields and publish/update "
175
  "the page.</li>"
176
  msgstr ""
177
 
178
- #: candide-vidbg.php:370
179
  msgid "<li>Enjoy.</li>"
180
  msgstr ""
181
 
182
- #: candide-vidbg.php:372
183
  msgid ""
184
  "<p>Alternatively, you can use the shortcode by placing the following code at "
185
  "the bottom of the content editor of the page or post you would like the "
186
  "video background to appear on. Here is how it works:</p>"
187
  msgstr ""
188
 
189
- #: candide-vidbg.php:374
190
  msgid ""
191
  "<a href=\"http://blakewilson.me/projects/video-background/\" class=\"button"
192
  "\" target=\"_blank\">Further Documentation</a>"
193
  msgstr ""
194
 
195
- #: candide-vidbg.php:375
196
  msgid "<h3>Questions?</h3>"
197
  msgstr ""
198
 
199
- #: candide-vidbg.php:376
200
  msgid ""
201
  "<p>If you have any feedback/questions regarding the plugin you can reach me "
202
  "<a href=\"https://wordpress.org/support/plugin/video-background\" target="
203
  "\"_blank\">here.</a>"
204
  msgstr ""
205
 
206
- #: candide-vidbg.php:377
207
- msgid "<h3>Support</h3>"
208
  msgstr ""
209
 
210
- #: candide-vidbg.php:378
211
  msgid ""
212
  "<p>If you like Video Background and want to show your support, consider "
213
- "purchasing the <a href=\"http://pushlabs.co/video-background-pro\" target="
214
- "\"_blank\">pro version</a>. It comes with plenty of helpful features that "
215
- "make your life easier like:</p>"
216
  msgstr ""
217
 
218
- #: candide-vidbg.php:380
219
  msgid "<li>YouTube Integration</li>"
220
  msgstr ""
221
 
222
- #: candide-vidbg.php:381
223
  msgid "<li>Visual Composer Integration</li>"
224
  msgstr ""
225
 
226
- #: candide-vidbg.php:382
227
  msgid "<li>Page Builder by SiteOrigin Integration</li>"
228
  msgstr ""
229
 
230
- #: candide-vidbg.php:383
231
  msgid "<li>Frontend Play/Pause Button Option</li>"
232
  msgstr ""
233
 
234
- #: candide-vidbg.php:384
235
  msgid "<li>Frontend Volume Button Option</li>"
236
  msgstr ""
237
 
238
- #: candide-vidbg.php:385
239
  msgid "<li>Overlay Image Textures</li>"
240
  msgstr ""
241
 
242
- #: candide-vidbg.php:386
243
  msgid "<li>Extensive Documentation</li>"
244
  msgstr ""
245
 
246
- #: candide-vidbg.php:387
247
  msgid "<li>Video Tutorials</li>"
248
  msgstr ""
249
 
250
- #: candide-vidbg.php:388
251
  msgid "<li>And Much More!</li>"
252
  msgstr ""
253
 
254
- #: candide-vidbg.php:390
255
  msgid ""
256
  "<a href=\"http://pushlabs.co/video-background-pro\" class=\"button button-"
257
- "primary\" target=\"_blank\">Purchase Video Background Pro</a>"
 
258
  msgstr ""
259
 
260
- #: candide-vidbg.php:391
261
  msgid ""
262
  " <a href=\"https://twitter.com/intent/follow?screen_name=blakewilsonme\" "
263
  "class=\"button button-primary vidbg-twitter\" target=\"_blank\">Get Updates "
264
  "on Twitter</a>"
265
  msgstr ""
266
 
 
 
 
 
267
  #: framework/includes/CMB2.php:122
268
  msgid "Metabox configuration is required to have an ID parameter"
269
  msgstr ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Video Background\n"
6
+ "POT-Creation-Date: 2016-06-24 00:51-0700\n"
7
  "PO-Revision-Date: 2016-03-30 22:31-0700\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
+ #: admin_premium_notice.php:11
24
  msgid ""
25
+ "Want more options like YouTube video backgrounds and frontend play/volume "
26
+ "buttons in Video Background? <a href=\"http://pushlabs.co/video-background-"
27
+ "pro\" rel=\"nofollow\" target=\"_blank\">Check out the new Video Background "
28
+ "Pro!</a>"
29
+ msgstr ""
30
+
31
+ #: candide-vidbg.php:71
32
+ msgid "Show Advanced Options"
33
+ msgstr ""
34
+
35
+ #: candide-vidbg.php:72
36
+ msgid "Hide Advanced Options"
37
  msgstr ""
38
 
39
  #. Plugin Name of the plugin/theme
40
+ #: candide-vidbg.php:163
41
  msgid "Video Background"
42
  msgstr ""
43
 
44
+ #: candide-vidbg.php:170
45
  msgid "Container"
46
  msgstr ""
47
 
48
+ #: candide-vidbg.php:171
49
  msgid ""
50
  "Please specify the container you would like your video background to be in."
51
  "<br>ex: <code>.header</code> or <code>body</code>"
52
  msgstr ""
53
 
54
+ #: candide-vidbg.php:175
55
+ msgid "YouTube Link"
56
+ msgstr ""
57
+
58
+ #: candide-vidbg.php:178
59
+ msgid ""
60
+ "To create YouTube video backgrounds, <a href=\"http://pushlabs.co/video-"
61
+ "background-pro\" rel=\"nofollow\" target=\"_blank\">please download the pro "
62
+ "version!</a>"
63
+ msgstr ""
64
+
65
+ #: candide-vidbg.php:183
66
  msgid "Link to .mp4"
67
  msgstr ""
68
 
69
+ #: candide-vidbg.php:184
70
  msgid ""
71
  "Please specify the link to the .mp4 file. You can either enter a URL or "
72
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
73
  "file for video backgrounds."
74
  msgstr ""
75
 
76
+ #: candide-vidbg.php:188
77
  msgid "Upload .mp4 file"
78
  msgstr ""
79
 
80
+ #: candide-vidbg.php:193
81
  msgid "Link to .webm"
82
  msgstr ""
83
 
84
+ #: candide-vidbg.php:194
85
  msgid ""
86
  "Please specify the link to the .webm file. You can either enter a URL or "
87
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
88
  "file for video backgrounds."
89
  msgstr ""
90
 
91
+ #: candide-vidbg.php:198
92
  msgid "Upload .webm file"
93
  msgstr ""
94
 
95
+ #: candide-vidbg.php:203
96
  msgid "Link to fallback image"
97
  msgstr ""
98
 
99
+ #: candide-vidbg.php:204
100
  msgid ""
101
  "Please specify a link to the fallback image in case the browser does not "
102
  "support video backgrounds. You can either enter a URL or upload a file."
103
  msgstr ""
104
 
105
+ #: candide-vidbg.php:208
106
  msgid "Upload fallback image"
107
  msgstr ""
108
 
109
+ #: candide-vidbg.php:213
110
  msgid "Overlay"
111
  msgstr ""
112
 
113
+ #: candide-vidbg.php:214
114
  msgid ""
115
  "Add an overlay over the video. This is useful if your text isn't readable "
116
  "with a video background."
117
  msgstr ""
118
 
119
+ #: candide-vidbg.php:219 candide-vidbg.php:256 candide-vidbg.php:268
120
  msgid "Off"
121
  msgstr ""
122
 
123
+ #: candide-vidbg.php:220 candide-vidbg.php:257 candide-vidbg.php:269
124
  msgid "On"
125
  msgstr ""
126
 
127
+ #: candide-vidbg.php:226
128
  msgid "Overlay Color"
129
  msgstr ""
130
 
131
+ #: candide-vidbg.php:227
132
  msgid ""
133
  "If overlay is enabled, a color will be used for the overlay. You can specify "
134
  "the color here."
135
  msgstr ""
136
 
137
+ #: candide-vidbg.php:234
138
  msgid "Overlay Opacity"
139
  msgstr ""
140
 
141
+ #: candide-vidbg.php:235
142
  msgid ""
143
  "Specify the opacity of the overlay with the left being mostly transparent "
144
  "and the right being hardly transparent."
145
  msgstr ""
146
 
147
+ #: candide-vidbg.php:242
148
+ msgid "Overlay Texture"
149
+ msgstr ""
150
+
151
+ #: candide-vidbg.php:245
152
+ msgid ""
153
+ "To add overlay textures to your video background, <a href=\"http://pushlabs."
154
+ "co/video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
155
+ "the pro version!</a>"
156
+ msgstr ""
157
+
158
+ #: candide-vidbg.php:250
159
  msgid "Turn off loop?"
160
  msgstr ""
161
 
162
+ #: candide-vidbg.php:251
163
  msgid ""
164
  "Turn off the loop for Video Background. Once the video is complete, it will "
165
  "display the last frame of the video."
166
  msgstr ""
167
 
168
+ #: candide-vidbg.php:262
169
  msgid "Play the audio?"
170
  msgstr ""
171
 
172
+ #: candide-vidbg.php:263
173
  msgid "Enabling this will play the audio of the video."
174
  msgstr ""
175
 
176
+ #: candide-vidbg.php:272
177
+ msgid "Enable Play/Pause button"
178
+ msgstr ""
179
+
180
+ #: candide-vidbg.php:275
181
+ msgid ""
182
+ "To enable a play/pause button on the frontend, <a href=\"http://pushlabs.co/"
183
+ "video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
184
+ "the pro version!</a>"
185
+ msgstr ""
186
+
187
+ #: candide-vidbg.php:277
188
+ msgid "Enable Mute/Unmute button"
189
+ msgstr ""
190
+
191
+ #: candide-vidbg.php:280
192
+ msgid ""
193
+ "To enable a mute/unmute button on the frontend, <a href=\"http://pushlabs.co/"
194
+ "video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
195
+ "the pro version!</a>"
196
+ msgstr ""
197
+
198
+ #: candide-vidbg.php:285
199
+ msgid ""
200
+ "<a href=\"#vidbg_advanced_options\" class=\"button vidbg-button advanced-"
201
+ "options-button\">Show Advanced options</a>"
202
+ msgstr ""
203
+
204
+ #: candide-vidbg.php:473 candide-vidbg.php:480
205
+ msgid "Hide Muted Pro Fields"
206
+ msgstr ""
207
+
208
+ #: candide-vidbg.php:510
209
+ msgid ""
210
+ "Okay, Okay, some of you don't want/need Video Background Pro. I get that. "
211
+ "That's why you can hide the muted pro fields below :)"
212
+ msgstr ""
213
+
214
+ #: candide-vidbg.php:525
215
  msgid "<h2>Video Background</h2>"
216
  msgstr ""
217
 
218
+ #: candide-vidbg.php:526
219
  msgid ""
220
  "<p>Video background makes it easy to add responsive, great looking video "
221
  "backgrounds to any element on your website.</p>"
222
  msgstr ""
223
 
224
+ #: candide-vidbg.php:527
225
  msgid "<h3>Getting Started</h3>"
226
  msgstr ""
227
 
228
+ #: candide-vidbg.php:528
229
  msgid ""
230
  "<p>To implement Video Background on your website, please follow the "
231
  "instructions below."
232
  msgstr ""
233
 
234
+ #: candide-vidbg.php:530
235
  msgid ""
236
  "<li>Edit the page or post you would like the video background to appear on.</"
237
  "li>"
238
  msgstr ""
239
 
240
+ #: candide-vidbg.php:531
241
  msgid ""
242
  "<li>Below the content editor, you should see a metabox titled <b>Video "
243
  "Background</b>. Enter the values for the required fields and publish/update "
244
  "the page.</li>"
245
  msgstr ""
246
 
247
+ #: candide-vidbg.php:532
248
  msgid "<li>Enjoy.</li>"
249
  msgstr ""
250
 
251
+ #: candide-vidbg.php:534
252
  msgid ""
253
  "<p>Alternatively, you can use the shortcode by placing the following code at "
254
  "the bottom of the content editor of the page or post you would like the "
255
  "video background to appear on. Here is how it works:</p>"
256
  msgstr ""
257
 
258
+ #: candide-vidbg.php:536
259
  msgid ""
260
  "<a href=\"http://blakewilson.me/projects/video-background/\" class=\"button"
261
  "\" target=\"_blank\">Further Documentation</a>"
262
  msgstr ""
263
 
264
+ #: candide-vidbg.php:537
265
  msgid "<h3>Questions?</h3>"
266
  msgstr ""
267
 
268
+ #: candide-vidbg.php:538
269
  msgid ""
270
  "<p>If you have any feedback/questions regarding the plugin you can reach me "
271
  "<a href=\"https://wordpress.org/support/plugin/video-background\" target="
272
  "\"_blank\">here.</a>"
273
  msgstr ""
274
 
275
+ #: candide-vidbg.php:539
276
+ msgid "<h3>Supporting the Plugin</h3>"
277
  msgstr ""
278
 
279
+ #: candide-vidbg.php:540
280
  msgid ""
281
  "<p>If you like Video Background and want to show your support, consider "
282
+ "purchasing the <a href=\"http://pushlabs.co/video-background-pro\" rel="
283
+ "\"nofollow\" target=\"_blank\">pro version</a>. It comes with plenty of "
284
+ "helpful features that make your life easier like:</p>"
285
  msgstr ""
286
 
287
+ #: candide-vidbg.php:542
288
  msgid "<li>YouTube Integration</li>"
289
  msgstr ""
290
 
291
+ #: candide-vidbg.php:543
292
  msgid "<li>Visual Composer Integration</li>"
293
  msgstr ""
294
 
295
+ #: candide-vidbg.php:544
296
  msgid "<li>Page Builder by SiteOrigin Integration</li>"
297
  msgstr ""
298
 
299
+ #: candide-vidbg.php:545
300
  msgid "<li>Frontend Play/Pause Button Option</li>"
301
  msgstr ""
302
 
303
+ #: candide-vidbg.php:546
304
  msgid "<li>Frontend Volume Button Option</li>"
305
  msgstr ""
306
 
307
+ #: candide-vidbg.php:547
308
  msgid "<li>Overlay Image Textures</li>"
309
  msgstr ""
310
 
311
+ #: candide-vidbg.php:548
312
  msgid "<li>Extensive Documentation</li>"
313
  msgstr ""
314
 
315
+ #: candide-vidbg.php:549
316
  msgid "<li>Video Tutorials</li>"
317
  msgstr ""
318
 
319
+ #: candide-vidbg.php:550
320
  msgid "<li>And Much More!</li>"
321
  msgstr ""
322
 
323
+ #: candide-vidbg.php:552
324
  msgid ""
325
  "<a href=\"http://pushlabs.co/video-background-pro\" class=\"button button-"
326
+ "primary\" rel=\"nofollow\" target=\"_blank\">Learn More About Video "
327
+ "Background Pro</a>"
328
  msgstr ""
329
 
330
+ #: candide-vidbg.php:553
331
  msgid ""
332
  " <a href=\"https://twitter.com/intent/follow?screen_name=blakewilsonme\" "
333
  "class=\"button button-primary vidbg-twitter\" target=\"_blank\">Get Updates "
334
  "on Twitter</a>"
335
  msgstr ""
336
 
337
+ #: candide-vidbg.php:570
338
+ msgid "<a href=\"options-general.php?page=html5-vidbg\">Getting Started</a>"
339
+ msgstr ""
340
+
341
  #: framework/includes/CMB2.php:122
342
  msgid "Metabox configuration is required to have an ID parameter"
343
  msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: blakedotvegas
3
  Tags: html5, video background, mp4, webm, responsive, shortcode, overlay, fullscreen background, fullscreen, html5 video background, metabox, blake wilson, loop, mute, unmute
4
  Requires at least: 3.8.0
5
- Tested up to: 4.5
6
- Stable tag: 2.5.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Donate link: https://www.paypal.me/blakewilsonme
@@ -75,12 +75,23 @@ This can be an issue with the file size of the video you are uploading. Make sur
75
 
76
  To add a video background to a class called **header** add ".header" to the container field. (without the quotes)
77
 
 
 
 
 
78
  == Screenshots ==
79
 
80
  1. 4 fields? That’s it? Yep, simply enter in the element you’d like the video background to be in and key in the paths to the video and fallback image. Awesome.
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
84
  = 2.5.3 =
85
  * Fixed notice option
86
 
2
  Contributors: blakedotvegas
3
  Tags: html5, video background, mp4, webm, responsive, shortcode, overlay, fullscreen background, fullscreen, html5 video background, metabox, blake wilson, loop, mute, unmute
4
  Requires at least: 3.8.0
5
+ Tested up to: 4.5.3
6
+ Stable tag: 2.5.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Donate link: https://www.paypal.me/blakewilsonme
75
 
76
  To add a video background to a class called **header** add ".header" to the container field. (without the quotes)
77
 
78
+ = The Video Background Pro fields are annoying, can I get rid of them? =
79
+
80
+ You sure can! Simply go to the "Settings > Video Background" menu tab and check the "Hide Muted Pro Fields" checkbox.
81
+
82
  == Screenshots ==
83
 
84
  1. 4 fields? That’s it? Yep, simply enter in the element you’d like the video background to be in and key in the paths to the video and fallback image. Awesome.
85
 
86
  == Changelog ==
87
 
88
+ = 2.5.4 =
89
+ * Fixed a bug that made the browser position jump when clicking the "Advanced Options" button
90
+ * Added better localization support for translations
91
+ * Cleaner code, well documented.
92
+ * Added Muted Video Background Pro fields (Do not worry, you can hide these)
93
+ * Added new stable tag for WP 4.5.3
94
+
95
  = 2.5.3 =
96
  * Fixed notice option
97