Video Background - Version 2.7.0

Version Description

  • Added: You can now add a video background to your WPBakery (Visual Composer) row!
  • Added: You can now add a video background to your SiteOrigin Page Builder row!
  • Added: vidbg_update_message() to let users know of crucial updates
  • Removed: vidbg_is_wp_version()
  • Removed: Pesky Video Background Pro fields
  • Updated: Settings page slug
  • Fixed: Simplified the plugin's resize methods.
  • Added: As a result of recent browser autoplay policy changes, the default audio on option has been removed. Now, you can add a nice "Tap to unmute" button to the video background!
Download this release

Release Info

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

Code changes from version 2.6.3 to 2.7.0

admin_premium_notice.php CHANGED
@@ -7,13 +7,13 @@
7
  * @uses get_option()
8
  */
9
  function vidbg_premium_notice() {
10
- $class = 'notice notice-success vidbg-premium-notice is-dismissible';
11
- $message = __( 'Video Background Pro now plays video backgrounds on supported mobile devices! <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">Check out 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
 
@@ -25,7 +25,7 @@ add_action( 'admin_notices', 'vidbg_premium_notice' );
25
  * @uses update_option()
26
  */
27
  function vidbg_dismiss_premium_notice() {
28
- update_option( 'vidbgpro-notice-dismissed', 1 );
29
  }
30
  add_action( 'wp_ajax_vidbg_dismiss_premium_notice', 'vidbg_dismiss_premium_notice' );
31
  ?>
7
  * @uses get_option()
8
  */
9
  function vidbg_premium_notice() {
10
+ $class = 'notice notice-success vidbg-premium-notice is-dismissible';
11
+ $message = __( 'Video Background Pro now plays video backgrounds on supported mobile devices! <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">Check out 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
 
25
  * @uses update_option()
26
  */
27
  function vidbg_dismiss_premium_notice() {
28
+ update_option( 'vidbgpro-notice-dismissed', 1 );
29
  }
30
  add_action( 'wp_ajax_vidbg_dismiss_premium_notice', 'vidbg_dismiss_premium_notice' );
31
  ?>
candide-vidbg.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Video Background
4
  Plugin URI: https://pushlabs.co/documentation/video-background
5
  Description: WordPress plugin to easily assign a video background to any element. Awesome.
6
  Author: Push Labs
7
- Version: 2.6.3
8
  Author URI: https://pushlabs.co
9
  Text Domain: video-background
10
  Domain Path: /languages
@@ -19,7 +19,7 @@ if ( !defined( 'ABSPATH' ) ) {
19
  define( 'VIDBG_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'VIDBG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
  define( 'VIDBG_PLUGIN_BASE', plugin_basename(__FILE__) );
22
- define( 'VIDBG_PLUGIN_VERSION', '2.6.3' );
23
 
24
  /**
25
  * Install the plugin
@@ -41,19 +41,44 @@ function vidbg_install_plugin() {
41
  register_activation_hook( __FILE__, 'vidbg_install_plugin' );
42
 
43
  /**
44
- * Create function to see if WordPress version is 4.2 or higher
45
  *
46
- * @since 2.5.1
47
  */
48
- function vidbg_is_wp_version( $version = '4.2' ) {
49
- global $wp_version;
50
-
51
- if ( version_compare( $wp_version, $version, '>=' ) ) {
52
- return true;
53
- } else {
54
- return false;
55
  }
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  /**
59
  * Include the metabox framework
@@ -68,6 +93,30 @@ if ( file_exists( dirname( __FILE__ ) . '/admin_premium_notice.php' ) ) {
68
  require_once dirname( __FILE__ ) . '/admin_premium_notice.php';
69
  }
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  /**
72
  * Load plugin textdomain.
73
  *
@@ -241,25 +290,9 @@ function vidbg_register_metabox() {
241
 
242
  $vidbg_metabox->add_field( array(
243
  'name' => __( 'Container', 'video-background' ),
244
- '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' ),
245
  'id' => $prefix . 'container',
246
  'type' => 'text',
247
- 'after_row' => vidbg_disabled_pro_field(
248
- __( 'YouTube Link', 'video-background' ),
249
- 'youtube_link',
250
- 'input',
251
- __( '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' )
252
- ) . vidbg_disabled_pro_field(
253
- __( 'YouTube Start Second', 'video-background' ),
254
- 'youtube_start',
255
- 'input',
256
- __( 'To use the YouTube Start Second feature, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
257
- ) . vidbg_disabled_pro_field(
258
- __( 'YouTube End Second', 'video-background' ),
259
- 'youtube_end',
260
- 'input',
261
- __( 'To use the YouTube End Second feature, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
262
- ),
263
  ) );
264
 
265
  $vidbg_metabox->add_field( array(
@@ -321,12 +354,6 @@ function vidbg_register_metabox() {
321
  'min' => '10',
322
  'max' => '99',
323
  'default' => '30',
324
- 'after_row' => vidbg_disabled_pro_field(
325
- __( 'Overlay Texture', 'video-background' ),
326
- 'overlay_texture',
327
- 'input',
328
- __( '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' )
329
- ),
330
  ) );
331
 
332
  $vidbg_metabox->add_field( array(
@@ -339,40 +366,19 @@ function vidbg_register_metabox() {
339
  'off' => __( 'Off', 'video-background' ),
340
  'on' => __( 'On', 'video-background' ),
341
  ),
342
- 'after_row' => vidbg_disabled_pro_field(
343
- __( 'End video on fallback image?', 'video-background' ),
344
- 'end_fallback',
345
- 'radio',
346
- __( 'To enable the end video on fallback image feature, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
347
- ) . vidbg_disabled_pro_field(
348
- __( 'Enable CSS loader?', 'video-background' ),
349
- 'enable_loader',
350
- 'radio',
351
- __( 'To enable the CSS loader feature, <a href="http://pushlabs.co/video-background-pro" rel="nofollow" target="_blank">please download the pro version!</a>', 'video-background' )
352
- ),
353
  ) );
354
 
355
  $vidbg_metabox->add_field( array(
356
- 'name' => __( 'Play the audio?', 'video-background' ),
357
- 'desc' => __( 'Enabling this will play the audio of the video.', 'video-background' ),
358
- 'id' => $prefix . 'unmute',
359
- 'type' => 'radio_inline',
360
- 'default' => 'off',
361
- 'options' => array(
362
  'off' => __( 'Off', 'video-background' ),
363
  'on' => __( 'On', 'video-background' ),
364
  ),
365
- 'after_row' => vidbg_disabled_pro_field(
366
- __( 'Enable Play/Pause button', 'video-background' ),
367
- 'play_button',
368
- 'radio',
369
- __( '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' )
370
- ) . vidbg_disabled_pro_field(
371
- __( 'Enable Mute/Unmute button', 'video-background' ),
372
- 'volume_button',
373
- 'radio',
374
- __( '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' )
375
- ) . '</div>',
376
  ) );
377
 
378
  $vidbg_metabox->add_field( array(
@@ -414,7 +420,7 @@ function vidbg_initialize_footer() {
414
  $overlay_color_meta = get_post_meta( $the_id, $meta_prefix . 'overlay_color', true );
415
  $overlay_alpha_meta = get_post_meta( $the_id, $meta_prefix . 'overlay_alpha', true );
416
  $loop_meta = get_post_meta( $the_id, $meta_prefix . 'no_loop', true );
417
- $mute_meta = get_post_meta( $the_id, $meta_prefix . 'unmute', true );
418
 
419
  // If there is no container element, return.
420
  if( empty( $container_meta ) ) {
@@ -431,7 +437,7 @@ function vidbg_initialize_footer() {
431
  'overlay_color' => !empty( $overlay_color_meta ) ? $overlay_color_meta : '#000',
432
  'overlay_alpha' => !empty( $overlay_alpha_meta ) ? '0.' . $overlay_alpha_meta : '0.3',
433
  'loop' => ( $loop_meta == 'on' ) ? 'false' : 'true',
434
- 'muted' => ( $mute_meta == 'on' ) ? 'false' : 'true',
435
  'source' => 'Metabox',
436
  );
437
 
@@ -467,31 +473,37 @@ function candide_video_background( $atts , $content = null ) {
467
  'overlay' => 'false',
468
  'overlay_color' => '#000',
469
  'overlay_alpha' => '0.3',
 
470
  'source' => 'Shortcode',
471
  ), $atts , 'vidbg'
472
  )
473
  );
474
 
475
- // Enqueue the vidbg script conditionally
476
- wp_enqueue_script( 'vidbg-video-background' );
 
477
 
478
- $output = "<script>
479
  jQuery(function($){
480
  // Source: " . $source . "
481
  $( '" . $container . "' ).vidbg( {
482
  mp4: '" . $mp4 . "',
483
  webm: '" . $webm . "',
484
  poster: '" . $poster . "',
485
- mute: " . $muted . ",
486
  repeat: " . $loop . ",
487
  overlay: " . $overlay . ",
488
  overlayColor: '" . $overlay_color . "',
489
  overlayAlpha: '" . $overlay_alpha . "',
 
 
490
  });
491
  });
492
- </script>";
 
 
 
 
493
 
494
- return $output;
495
  }
496
  add_shortcode( 'vidbg', 'candide_video_background' );
497
 
@@ -507,74 +519,12 @@ function vidbg_add_gettingstarted() {
507
  'Video Background',
508
  'Video Background',
509
  'manage_options',
510
- 'html5-vidbg',
511
  'vidbg_gettingstarted_page'
512
  );
513
  }
514
  add_action( 'admin_menu', 'vidbg_add_gettingstarted' );
515
 
516
- /**
517
- * Creates Video Background plugin settings
518
- *
519
- * @since 2.5.4
520
- *
521
- * @uses register_setting()
522
- * @uses add_settings_section()
523
- * @uses add_settings_field()
524
- */
525
- function vidbg_register_settings() {
526
- register_setting( 'vidbg_settings', 'vidbg_disable_pro_fields' );
527
-
528
- add_settings_section(
529
- 'vidbg_vidbg_settings_section',
530
- __( 'Hide Muted Pro Fields', 'video-background' ),
531
- 'vidbg_disable_pro_fields_section_callback',
532
- 'vidbg_settings'
533
- );
534
-
535
- add_settings_field(
536
- 'vidbg_checkbox_disable_pro_field',
537
- __( 'Hide Muted Pro Fields', 'video-background' ),
538
- 'vidbg_checkbox_disable_pro_field_render',
539
- 'vidbg_settings',
540
- 'vidbg_vidbg_settings_section'
541
- );
542
- }
543
- add_action( 'admin_init', 'vidbg_register_settings' );
544
-
545
- /**
546
- * Creats the checkbox callback for Video Background options
547
- *
548
- * @since 2.5.4
549
- *
550
- * @uses get_option()
551
- * @uses checked()
552
- */
553
- function vidbg_checkbox_disable_pro_field_render() {
554
- $options = get_option( 'vidbg_disable_pro_fields' );
555
-
556
- $output = '';
557
- $check = '';
558
- if ( $options ) {
559
- $check = checked( $options['vidbg_checkbox_disable_pro_field'], 1, false );
560
- }
561
-
562
- $output .= '<input type="checkbox" name="vidbg_disable_pro_fields[vidbg_checkbox_disable_pro_field]" ' . $check . ' value="1">';
563
-
564
- echo $output;
565
- }
566
-
567
- /**
568
- * Video Background plugin settings section callback
569
- *
570
- * @since 2.5.4
571
- *
572
- * @uses _e()
573
- */
574
- function vidbg_disable_pro_fields_section_callback() {
575
- _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' );
576
- }
577
-
578
  /**
579
  * Getting started page content
580
  *
@@ -590,24 +540,21 @@ function vidbg_gettingstarted_page() {
590
  _e( '<h2>Video Background</h2>', 'video-background' );
591
  _e( '<p>Video background makes it easy to add responsive, great looking video backgrounds to any element on your website.</p>', 'video-background' );
592
  _e( '<h3>Getting Started</h3>', 'video-background' );
593
- _e( '<p>To implement Video Background on your website, please follow the instructions below.', 'video-background' );
594
  echo '<ol>';
595
- _e( '<li>Edit the page or post you would like the video background to appear on.</li>', 'video-background' );
596
- _e( '<li>Below the content editor, you should see a metabox titled <b>Video Background</b>. Enter the values for the required fields and publish/update the page.</li>', 'video-background' );
597
- _e( '<li>Enjoy.</li>', 'video-background' );
 
598
  echo '</ol>';
599
- _e( '<p>Alternatively, you can use the shortcode by placing the following code at the bottom of the content editor of the page or post you would like the video background to appear on. Here is how it works:</p>', 'video-background' );
600
- echo '<p><code>[vidbg container=&quot;body&quot; mp4=&quot;#&quot; webm=&quot;#&quot; poster=&quot;#&quot; loop=&quot;true&quot; overlay=&quot;false&quot; overlay_color=&quot;#000&quot; overlay_alpha=&quot;0.3&quot; muted=&quot;false&quot;]</code></p>';
601
  _e( '<a href="https://pushlabs.co/docs/video-background/" class="button" target="_blank">Further Documentation</a>', 'video-background' );
602
  _e( '<h3>Questions?</h3>', 'video-background' );
603
  _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' );
604
  _e( '<h3>Supporting the Plugin</h3>', 'video-background' );
605
- _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' );
606
  echo '<ul>';
607
  _e( '<li>Mobile video background playback on supported browsers</li>', 'video-background' );
608
  _e( '<li>YouTube Integration</li>', 'video-background' );
609
- _e( '<li>Visual Composer Integration</li>', 'video-background' );
610
- _e( '<li>Page Builder by SiteOrigin Integration</li>', 'video-background' );
611
  _e( '<li>Frontend Play/Pause Button Option</li>', 'video-background' );
612
  _e( '<li>Frontend Volume Button Option</li>', 'video-background' );
613
  _e( '<li>Overlay Image Textures</li>', 'video-background' );
@@ -616,11 +563,6 @@ function vidbg_gettingstarted_page() {
616
  _e( '<li>And Much More!</li>', 'video-background' );
617
  echo '</ul>';
618
  _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' );
619
- echo '<form action="options.php" method="post">';
620
- settings_fields( 'vidbg_settings' );
621
- do_settings_sections( 'vidbg_settings' );
622
- submit_button();
623
- echo '</form>';
624
  echo '</div>';
625
  }
626
 
@@ -632,8 +574,33 @@ function vidbg_gettingstarted_page() {
632
  * @uses __()
633
  */
634
  function vidbg_gettingstarted_link($links) {
635
- $gettingstarted_link = __( '<a href="options-general.php?page=html5-vidbg">Getting Started</a>', 'video-background' );
636
  array_unshift($links, $gettingstarted_link);
637
  return $links;
638
  }
639
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'vidbg_gettingstarted_link' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  Plugin URI: https://pushlabs.co/documentation/video-background
5
  Description: WordPress plugin to easily assign a video background to any element. Awesome.
6
  Author: Push Labs
7
+ Version: 2.7.0
8
  Author URI: https://pushlabs.co
9
  Text Domain: video-background
10
  Domain Path: /languages
19
  define( 'VIDBG_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'VIDBG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
  define( 'VIDBG_PLUGIN_BASE', plugin_basename(__FILE__) );
22
+ define( 'VIDBG_PLUGIN_VERSION', '2.7.0' );
23
 
24
  /**
25
  * Install the plugin
41
  register_activation_hook( __FILE__, 'vidbg_install_plugin' );
42
 
43
  /**
44
+ * Display a notice if the update is important
45
  *
46
+ * @since 3.0.0
47
  */
48
+ function vidbg_update_message( $data, $response ) {
49
+ if ( isset( $data['upgrade_notice'] ) ) {
50
+ printf( '<div class="vidbg-update-message">%s</div>', wpautop( $data['upgrade_notice'] ) );
 
 
 
 
51
  }
52
  }
53
+ add_action( 'in_plugin_update_message-video-background/candide-vidbg.php', 'vidbg_update_message', 10, 2 );
54
+
55
+ /**
56
+ * Determines if VC integration should be added
57
+ *
58
+ * @since 2.2.0
59
+ *
60
+ * @return Boolean
61
+ */
62
+ function vidbg_is_vc_enabled() {
63
+ $is_enabled = true;
64
+ $is_enabled = apply_filters( 'vidbg_is_vc_enabled', $is_enabled );
65
+
66
+ return $is_enabled;
67
+ }
68
+
69
+ /**
70
+ * Determines if SiteOrigin integration should be added
71
+ *
72
+ * @since 2.2.0
73
+ *
74
+ * @return Boolean
75
+ */
76
+ function vidbg_is_siteorigin_enabled() {
77
+ $is_enabled = true;
78
+ $is_enabled = apply_filters( 'vidbg_is_siteorigin_enabled', $is_enabled );
79
+
80
+ return $is_enabled;
81
+ }
82
 
83
  /**
84
  * Include the metabox framework
93
  require_once dirname( __FILE__ ) . '/admin_premium_notice.php';
94
  }
95
 
96
+ /**
97
+ * Load the WPBakery (Visual Composer) integration if conditions are met
98
+ *
99
+ * @since 3.0.0
100
+ */
101
+ function vidbg_load_vc_integration() {
102
+ if ( class_exists( 'Vc_Manager' ) && vidbg_is_vc_enabled() === true ) {
103
+ require_once dirname( __FILE__ ) . '/inc/classes/vidbg_wpbakery.php';
104
+ }
105
+ }
106
+ add_action( 'after_setup_theme', 'vidbg_load_vc_integration' );
107
+
108
+ /**
109
+ * Load the SiteOrigin Page Builder integration if conditions are met
110
+ *
111
+ * @since 3.0.0
112
+ */
113
+ function vidbg_load_siteorigin_integration() {
114
+ if ( class_exists( 'SiteOrigin_Panels_Css_Builder' ) && vidbg_is_siteorigin_enabled() === true ) {
115
+ require_once dirname( __FILE__ ) . '/inc/classes/vidbg_siteorigin.php';
116
+ }
117
+ }
118
+ add_action( 'after_setup_theme', 'vidbg_load_siteorigin_integration' );
119
+
120
  /**
121
  * Load plugin textdomain.
122
  *
290
 
291
  $vidbg_metabox->add_field( array(
292
  'name' => __( 'Container', 'video-background' ),
293
+ 'desc' => __( 'Please specify the container you would like your video background to be in. <a href="https://pushlabs.co/docs/video-background/#finding-your-container" target="_blank">Learn how to find your container.</a>', 'video-background' ),
294
  'id' => $prefix . 'container',
295
  'type' => 'text',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  ) );
297
 
298
  $vidbg_metabox->add_field( array(
354
  'min' => '10',
355
  'max' => '99',
356
  'default' => '30',
 
 
 
 
 
 
357
  ) );
358
 
359
  $vidbg_metabox->add_field( array(
366
  'off' => __( 'Off', 'video-background' ),
367
  'on' => __( 'On', 'video-background' ),
368
  ),
 
 
 
 
 
 
 
 
 
 
 
369
  ) );
370
 
371
  $vidbg_metabox->add_field( array(
372
+ 'name' => __( 'Display "Tap to unmute" button?', 'video-background' ),
373
+ 'desc' => __( 'Allow your users to interact with the sound of the video background. <a href="https://pushlabs.co/docs/video-background/#tap-to-unmute-text" target="_blank">Learn how to change this text.</a>', 'video-background' ),
374
+ 'id' => $prefix . 'tap_to_unmute',
375
+ 'type' => 'radio_inline',
376
+ 'default' => 'off',
377
+ 'options' => array(
378
  'off' => __( 'Off', 'video-background' ),
379
  'on' => __( 'On', 'video-background' ),
380
  ),
381
+ 'after_row' => '</div>',
 
 
 
 
 
 
 
 
 
 
382
  ) );
383
 
384
  $vidbg_metabox->add_field( array(
420
  $overlay_color_meta = get_post_meta( $the_id, $meta_prefix . 'overlay_color', true );
421
  $overlay_alpha_meta = get_post_meta( $the_id, $meta_prefix . 'overlay_alpha', true );
422
  $loop_meta = get_post_meta( $the_id, $meta_prefix . 'no_loop', true );
423
+ $tap_to_unmute_meta = get_post_meta( $the_id, $meta_prefix . 'tap_to_unmute', true );
424
 
425
  // If there is no container element, return.
426
  if( empty( $container_meta ) ) {
437
  'overlay_color' => !empty( $overlay_color_meta ) ? $overlay_color_meta : '#000',
438
  'overlay_alpha' => !empty( $overlay_alpha_meta ) ? '0.' . $overlay_alpha_meta : '0.3',
439
  'loop' => ( $loop_meta == 'on' ) ? 'false' : 'true',
440
+ 'tap_to_unmute' => ( $tap_to_unmute_meta == 'on' ) ? 'true' : 'false',
441
  'source' => 'Metabox',
442
  );
443
 
473
  'overlay' => 'false',
474
  'overlay_color' => '#000',
475
  'overlay_alpha' => '0.3',
476
+ 'tap_to_unmute' => 'false',
477
  'source' => 'Shortcode',
478
  ), $atts , 'vidbg'
479
  )
480
  );
481
 
482
+ $tap_to_unmute_text = __( 'Tap to Unmute', 'video-background' );
483
+ $tap_to_unmute_text = apply_filters( 'vidbg_tap_to_unmute_text', $tap_to_unmute_text );
484
+ $tap_to_unmute_button = '<img src="' . plugins_url( 'img/volume-icon.svg', __FILE__ ) . '" width="20" height="20" /><span>' . $tap_to_unmute_text . '</span>';
485
 
486
+ $output = "
487
  jQuery(function($){
488
  // Source: " . $source . "
489
  $( '" . $container . "' ).vidbg( {
490
  mp4: '" . $mp4 . "',
491
  webm: '" . $webm . "',
492
  poster: '" . $poster . "',
 
493
  repeat: " . $loop . ",
494
  overlay: " . $overlay . ",
495
  overlayColor: '" . $overlay_color . "',
496
  overlayAlpha: '" . $overlay_alpha . "',
497
+ tapToUnmute: " . $tap_to_unmute . ",
498
+ tapToUnmuteText: '" . $tap_to_unmute_button . "',
499
  });
500
  });
501
+ ";
502
+
503
+ // Enqueue the vidbg script conditionally
504
+ wp_enqueue_script( 'vidbg-video-background' );
505
+ wp_add_inline_script( 'vidbg-video-background', $output );
506
 
 
507
  }
508
  add_shortcode( 'vidbg', 'candide_video_background' );
509
 
519
  'Video Background',
520
  'Video Background',
521
  'manage_options',
522
+ 'pushlabs-vidbg',
523
  'vidbg_gettingstarted_page'
524
  );
525
  }
526
  add_action( 'admin_menu', 'vidbg_add_gettingstarted' );
527
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
528
  /**
529
  * Getting started page content
530
  *
540
  _e( '<h2>Video Background</h2>', 'video-background' );
541
  _e( '<p>Video background makes it easy to add responsive, great looking video backgrounds to any element on your website.</p>', 'video-background' );
542
  _e( '<h3>Getting Started</h3>', 'video-background' );
543
+ _e( '<p>There are four ways to use Video Background', 'video-background' );
544
  echo '<ol>';
545
+ _e( '<li>With the metabox</li>', 'video-background' );
546
+ _e( '<li>With the WPBakery (Visual Composer) integration</li>', 'video-background' );
547
+ _e( '<li>With the SiteOrigin Page Builder integration</li>', 'video-background' );
548
+ _e( '<li>With the shortcode</li>', 'video-background' );
549
  echo '</ol>';
 
 
550
  _e( '<a href="https://pushlabs.co/docs/video-background/" class="button" target="_blank">Further Documentation</a>', 'video-background' );
551
  _e( '<h3>Questions?</h3>', 'video-background' );
552
  _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' );
553
  _e( '<h3>Supporting the Plugin</h3>', 'video-background' );
554
+ _e( '<p>If you like Video Background and want to show your support, consider purchasing <a href="http://pushlabs.co/video-background-pro" target="_blank">Video Background Pro</a>. It comes with plenty of helpful features that make your life easier like:</p>', 'video-background' );
555
  echo '<ul>';
556
  _e( '<li>Mobile video background playback on supported browsers</li>', 'video-background' );
557
  _e( '<li>YouTube Integration</li>', 'video-background' );
 
 
558
  _e( '<li>Frontend Play/Pause Button Option</li>', 'video-background' );
559
  _e( '<li>Frontend Volume Button Option</li>', 'video-background' );
560
  _e( '<li>Overlay Image Textures</li>', 'video-background' );
563
  _e( '<li>And Much More!</li>', 'video-background' );
564
  echo '</ul>';
565
  _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' );
 
 
 
 
 
566
  echo '</div>';
567
  }
568
 
574
  * @uses __()
575
  */
576
  function vidbg_gettingstarted_link($links) {
577
+ $gettingstarted_link = __( '<a href="options-general.php?page=pushlabs-vidbg">Getting Started</a>', 'video-background' );
578
  array_unshift($links, $gettingstarted_link);
579
  return $links;
580
  }
581
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'vidbg_gettingstarted_link' );
582
+
583
+ /**
584
+ * Create a unique random class name to be used as a reference for other plugin integrations.
585
+ *
586
+ * @since 2.7.0
587
+ *
588
+ * @return String The reference class name (without the period prefix)
589
+ */
590
+ function vidbg_create_unique_ref() {
591
+ // Our possible list of characters
592
+ $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
593
+ $charactersLength = strlen( $characters );
594
+ $length = 14;
595
+
596
+ // Create our string
597
+ $unique_ref = '';
598
+ for ( $i = 0; $i < $length; $i++ ) {
599
+ $unique_ref .= $characters[rand(0, $charactersLength - 1)];
600
+ }
601
+
602
+ // Create our output
603
+ $output = 'vidbg-ref-' . $unique_ref;
604
+
605
+ return $output;
606
+ }
css/pushlabs-vidbg.css CHANGED
@@ -31,3 +31,21 @@
31
  bottom: 0;
32
  opacity: 1;
33
  transition: opacity 0.5s ease; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  bottom: 0;
32
  opacity: 1;
33
  transition: opacity 0.5s ease; }
34
+
35
+ .vidbg-tap-to-unmute {
36
+ cursor: pointer;
37
+ position: absolute;
38
+ top: 20px;
39
+ left: 20px;
40
+ background-color: rgba(255, 255, 255, 0.9);
41
+ padding: 5px 10px;
42
+ border-radius: 5px;
43
+ transition: background-color 0.2s ease-in-out;
44
+ display: flex;
45
+ align-items: center; }
46
+ .vidbg-tap-to-unmute img {
47
+ width: 20px;
48
+ height: 20px;
49
+ margin-right: 7px; }
50
+ .vidbg-tap-to-unmute:hover {
51
+ background-color: rgba(230, 229, 229, 0.9); }
css/pushlabs-vidbg.scss CHANGED
@@ -35,3 +35,27 @@
35
  opacity: 1;
36
  transition: opacity 0.5s ease;
37
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  opacity: 1;
36
  transition: opacity 0.5s ease;
37
  }
38
+
39
+ .vidbg-tap-to-unmute {
40
+ cursor: pointer;
41
+ position: absolute;
42
+ top: 20px;
43
+ left: 20px;
44
+ background-color: rgba(255, 255, 255, 0.9);
45
+ padding: 5px 10px;
46
+ border-radius: 5px;
47
+ transition: background-color 0.2s ease-in-out;
48
+
49
+ display: flex;
50
+ align-items: center;
51
+
52
+ img {
53
+ width: 20px;
54
+ height: 20px;
55
+ margin-right: 7px;
56
+ }
57
+
58
+ &:hover {
59
+ background-color: darken( rgba(255, 255, 255, 0.9), 10% );
60
+ }
61
+ }
img/volume-icon.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="423px" height="442px" viewBox="0 0 423 442" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 49.2 (51160) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Volume Icon</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Custom-Preset" transform="translate(-30.000000, -23.000000)" fill="#000000">
9
+ <g id="Volume-Icon" transform="translate(30.000000, 23.000000)">
10
+ <path d="M273,442 C372.543788,376.03662 422.315682,302.369953 422.315682,221 C422.315682,139.630047 372.543788,65.9633802 273,0 L273,77.1458879 C330.704122,125.097791 359.556182,173.049162 359.556182,221 C359.556182,268.950838 330.704122,316.901349 273,364.851533 L273,442 Z" id="large-Sound-Wave"></path>
11
+ <path d="M273,330 C316.491815,297.615264 338.237722,261.448597 338.237722,221.5 C338.237722,181.551403 316.491815,145.384736 273,113 L273,330 Z" id="Small-Sound-Wave"></path>
12
+ <path d="M248.544883,220.784004 L248.627034,220.784004 L248.627034,442 L113.79161,307.164576 L0.0821504895,307.164576 L0.0821504895,221.215996 L0,221.215996 L0,134.835424 L113.709459,134.835424 L248.544883,0 L248.544883,220.784004 Z" id="Speaker"></path>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </svg>
inc/classes/cmb2_field_slider.php CHANGED
@@ -1,23 +1,23 @@
1
  <?php
2
  class Vidbg_Field_Slider {
3
- const VERSION = '0.1.0';
4
- public function hooks() {
5
- add_filter( 'cmb2_render_vidbg_slider', array( $this, 'vidbg_slider_field' ), 10, 5 );
6
- }
7
- public function vidbg_slider_field( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) {
8
- echo '<div class="vidbg-slider-field"></div>';
9
- echo $field_type_object->input( array(
10
- 'type' => 'hidden',
11
- 'class' => 'vidbg-slider-field-value',
12
- 'readonly' => 'readonly',
13
- 'data-start' => absint( $field_escaped_value ),
14
- 'data-min' => $field->min(),
15
- 'data-max' => $field->max(),
16
- 'desc' => '',
17
- ) );
18
- echo '<span class="vidbg-slider-field-value-display">'. $field->value_label() .' <span class="vidbg-slider-field-value-text"></span></span>';
19
- $field_type_object->_desc( true, true );
20
- }
21
  }
22
  $vidbg_field_slider = new Vidbg_Field_Slider();
23
  $vidbg_field_slider->hooks();
1
  <?php
2
  class Vidbg_Field_Slider {
3
+ const VERSION = '0.1.0';
4
+ public function hooks() {
5
+ add_filter( 'cmb2_render_vidbg_slider', array( $this, 'vidbg_slider_field' ), 10, 5 );
6
+ }
7
+ public function vidbg_slider_field( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) {
8
+ echo '<div class="vidbg-slider-field"></div>';
9
+ echo $field_type_object->input( array(
10
+ 'type' => 'hidden',
11
+ 'class' => 'vidbg-slider-field-value',
12
+ 'readonly' => 'readonly',
13
+ 'data-start' => absint( $field_escaped_value ),
14
+ 'data-min' => $field->min(),
15
+ 'data-max' => $field->max(),
16
+ 'desc' => '',
17
+ ) );
18
+ echo '<span class="vidbg-slider-field-value-display">'. $field->value_label() .' <span class="vidbg-slider-field-value-text"></span></span>';
19
+ $field_type_object->_desc( true, true );
20
+ }
21
  }
22
  $vidbg_field_slider = new Vidbg_Field_Slider();
23
  $vidbg_field_slider->hooks();
inc/classes/vidbg_siteorigin.php ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Video Background's class to add a video background to a SiteOrigin Page Builder row
5
+ *
6
+ * @author Push Labs https://pushlabs.co
7
+ * @copyright Copyright (c) Push Labs (hello@pushlabs.co)
8
+ * @since 2.7.0
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ if ( ! class_exists( 'Vidbg_SiteOrigin' ) ) {
16
+ /**
17
+ * SiteOrigin Page Builder Integration
18
+ *
19
+ * @package Video Background/Video Background Pro
20
+ * @author Push Labs
21
+ * @version 1.0.0
22
+ */
23
+ class Vidbg_SiteOrigin {
24
+
25
+ // Class' properties
26
+ private $prefix;
27
+ private $group_name;
28
+ protected $vidbg_atts;
29
+
30
+ public function __construct() {
31
+ // The data prefix for the attributes we'll add to SiteOrigin Page Builder
32
+ $this->prefix = 'vidbg_so_';
33
+
34
+ // The SiteOrigin Page Builder Row Group
35
+ $this->group_name = 'vidbg_so';
36
+
37
+ // $vidbg_atts will hold our [vidbg] shortcode attributes
38
+ $this->vidbg_atts = array();
39
+
40
+ // Add our filters to execute our methods
41
+ add_filter( 'siteorigin_panels_row_style_fields', array( $this, 'register_fields' ) );
42
+ add_filter( 'siteorigin_panels_row_style_groups', array( $this, 'create_group' ), 10, 3 );
43
+ add_filter( 'siteorigin_panels_before_row', array( $this, 'generate_shortcode_before_row' ), 10, 3 );
44
+ }
45
+
46
+ /**
47
+ * Create SiteOrigin group for Video Background on row
48
+ *
49
+ * @since 2.7.0
50
+ */
51
+ public function create_group( $groups, $post_id, $args ) {
52
+ $groups[$this->group_name] = array(
53
+ 'name' => __( 'Video Background', 'video-background' ),
54
+ 'priority' => 25,
55
+ );
56
+ return $groups;
57
+ }
58
+
59
+ /**
60
+ * Add fields to SiteOrigin Page Builder row
61
+ *
62
+ * @since 2.7.0
63
+ */
64
+ public function register_fields( $fields ) {
65
+
66
+ $fields[$this->prefix . 'mp4'] = array(
67
+ 'name' => __( 'Link to .mp4', 'video-background' ),
68
+ 'type' => 'url',
69
+ 'description' => __( 'Please specify the link to the .mp4 file.', 'video-background' ),
70
+ 'group' => $this->group_name,
71
+ 'priority' => 10,
72
+ );
73
+
74
+ $fields[$this->prefix . 'webm'] = array(
75
+ 'type' => 'url',
76
+ 'name' => __( 'Link to .webm', 'video-background' ),
77
+ 'description' => __( 'Please specify the link to the .webm file.', 'video-background' ),
78
+ 'group' => $this->group_name,
79
+ 'priority' => 20,
80
+ );
81
+
82
+ $fields[$this->prefix . 'poster'] = array(
83
+ 'type' => 'image',
84
+ 'name' => __( 'Fallback Image', 'video-background' ),
85
+ 'description' => __( 'Please upload a fallback image.', 'video-background' ),
86
+ 'group' => $this->group_name,
87
+ 'priority' => 30,
88
+ );
89
+
90
+ $fields[$this->prefix . 'overlay'] = array(
91
+ 'type' => 'checkbox',
92
+ 'name' => __( 'Enable Overlay?', 'video-background' ),
93
+ 'description' => __( 'Add an overlay over the video. This is useful if your text isn\'t readable with a video background.', 'video-background' ),
94
+ 'group' => $this->group_name,
95
+ 'priority' => 40,
96
+ );
97
+
98
+ $fields[$this->prefix . 'overlay_color'] = array(
99
+ 'type' => 'color',
100
+ 'name' => __( 'Overlay Color', 'video-background' ),
101
+ 'description' => __( 'If overlay is enabled, a color will be used for the overlay. You can specify the color here.', 'video-background' ),
102
+ 'default' => '#000',
103
+ 'group' => $this->group_name,
104
+ 'priority' => 50,
105
+ );
106
+
107
+ $fields[$this->prefix . 'overlay_alpha'] = array(
108
+ 'type' => 'text',
109
+ 'name' => __( 'Overlay Opacity', 'video-background' ),
110
+ 'description' => __( 'Specify the opacity of the overlay. Accepts any value between 0.00-1.00 with 0 being completely transparent and 1 being completely invisible. Ex. 0.30', 'video-background' ),
111
+ 'default' => '0.3',
112
+ 'group' => $this->group_name,
113
+ 'priority' => 60,
114
+ );
115
+
116
+ $fields[$this->prefix . 'loop'] = array(
117
+ 'type' => 'checkbox',
118
+ 'name' => __( 'Disable Loop?', 'video-background' ),
119
+ 'description' => __( 'Turn off the loop for Video Background. Once the video is complete, it will display the last frame of the video.', 'video-background' ),
120
+ 'group' => $this->group_name,
121
+ 'priority' => 70,
122
+ );
123
+
124
+ // Only add tap to unmute if is not Video Background Pro
125
+ if ( ! function_exists( 'vidbgpro_install_plugin' ) ) {
126
+ $fields[$this->prefix . 'tap_to_unmute'] = array(
127
+ 'type' => 'checkbox',
128
+ 'name' => __( 'Display "Tap to unmute" button?', 'video-background' ),
129
+ 'description' => __( 'Allow your users to interact with the sound of the video background.', 'video-background' ),
130
+ 'group' => $this->group_name,
131
+ 'priority' => 80,
132
+ );
133
+ }
134
+
135
+ $fields = apply_filters( 'vidbg_siteorigin_fields', $fields );
136
+
137
+ return $fields;
138
+ }
139
+
140
+ /**
141
+ * Find all attributes with the prefix and add them to the $vidbg_atts array
142
+ *
143
+ * @since 2.7.0
144
+ */
145
+ public function get_vidbg_attributes( $siteorigin_row_atts ) {
146
+
147
+ if ( $siteorigin_row_atts === null ) {
148
+ return;
149
+ }
150
+
151
+ // Run a foreach loop on the SiteOrigin Page Builder Row atts
152
+ foreach ( $siteorigin_row_atts as $attribute_key => $attribute ) {
153
+ // Find the attributes with the $prefix
154
+ if ( substr( $attribute_key, 0, strlen( $this->prefix ) ) === $this->prefix ) {
155
+ // Remove the $prefix
156
+ $attribute_key = substr( $attribute_key, strlen( $this->prefix ) );
157
+
158
+ // Add the attribute to the $vidbg_atts array
159
+ // Only add attribute if it's not empty
160
+ if ( !empty( $attribute ) ) {
161
+ $this->vidbg_atts[$attribute_key] = $attribute;
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Generate the shortcode and place it before the SiteOrigin row
169
+ *
170
+ * @since 2.7.0
171
+ */
172
+ public function generate_shortcode_before_row( $output, $grid_item, $grid_attributes ) {
173
+
174
+ // Use to test the attributes gathered in $grid_item
175
+ // var_dump( $grid_item['style'] );
176
+
177
+ // Get the $vidbg_atts
178
+ $this->get_vidbg_attributes( $grid_item['style'] );
179
+
180
+ // Conditionally determine if the row has a video background
181
+ if ( function_exists( 'vidbgpro_install_plugin' ) ) {
182
+ // If plugin is Video Background Pro
183
+
184
+ if ( ! isset( $this->vidbg_atts['type'] ) ) {
185
+ return;
186
+ }
187
+
188
+ // If type is YouTube and YouTube URL param is empty, quit
189
+ if ( $this->vidbg_atts['type'] === 'youtube' && empty( $this->vidbg_atts['youtube_url'] ) ) {
190
+ var_dump( 'no youtube video exists' );
191
+ return;
192
+ }
193
+
194
+ // If type is self-host and mp4 amd webm param are both empty, quit
195
+ if ( $this->vidbg_atts['type'] === 'self-host' && empty( $this->vidbg_atts['mp4'] ) && empty( $this->vidbg_atts['webm'] ) ) {
196
+ var_dump( 'no self hosted video exists' );
197
+ return;
198
+ }
199
+ } else {
200
+ // If plugin is Video Background
201
+
202
+ // If mp4 and webm params are empty, quit
203
+ if ( empty( $this->vidbg_atts['mp4'] ) && empty( $this->vidbg_atts['webm'] ) ) {
204
+ return;
205
+ }
206
+ }
207
+
208
+ if ( array_key_exists( 'loop', $this->vidbg_atts ) ) {
209
+ $this->vidbg_atts['loop'] = $this->vidbg_atts['loop'] === true ? 'false' : 'true';
210
+ }
211
+
212
+ if ( array_key_exists( 'poster', $this->vidbg_atts ) ) {
213
+ $poster_src_arr = wp_get_attachment_image_src( $this->vidbg_atts['poster'], 'full' );
214
+ $this->vidbg_atts['poster'] = $poster_src_arr[0];
215
+ }
216
+
217
+ // If there is an external URL set for the site origin file, use it instead of the WP media upload
218
+ if ( array_key_exists( 'poster_fallback', $this->vidbg_atts ) ) {
219
+ $this->vidbg_atts['poster'] = $this->vidbg_atts['poster_fallback'];
220
+ }
221
+
222
+ $this->vidbg_atts = apply_filters( 'vidbg_sanitize_siteorigin_fields', $this->vidbg_atts );
223
+
224
+ // Create our container selector
225
+ // Check if plugin is Video Background Pro or Video Background
226
+ if ( function_exists( 'vidbgpro_create_unique_ref' ) ) {
227
+ $unique_class = vidbgpro_create_unique_ref();
228
+ } else {
229
+ $unique_class = vidbg_create_unique_ref();
230
+ }
231
+
232
+ $row_class = $unique_class . '-row';
233
+ $container_class = $unique_class . '-container';
234
+
235
+ // Add our class to the shortcode atts array
236
+ $this->vidbg_atts['container'] = '.' . $container_class;
237
+
238
+ // Add our source to the shortcode atts array
239
+ $this->vidbg_atts['source'] = 'SiteOrigin Page Builder Integration';
240
+
241
+ // Use to test the attributes created for $vidbg_atts
242
+ // var_dump( $this->vidbg_atts );
243
+
244
+ // Our jQuery code to add the container class to the container so we can target the SiteOrigin row
245
+ $add_container_to_row = "
246
+ jQuery(function($){
247
+ $('." . $unique_class . "').next('.panel-grid').addClass('" . $row_class . "');
248
+
249
+ if( $('.panel-grid." . $row_class . " > .siteorigin-panels-stretch').length ) {
250
+ $('.panel-grid." . $row_class . " > .siteorigin-panels-stretch').addClass( '" . $container_class ."' );
251
+ } else {
252
+ $('.panel-grid." . $row_class . "').addClass( '" . $container_class ."' );
253
+ }
254
+ });
255
+ ";
256
+
257
+ if ( function_exists( 'vidbgpro_install_plugin' ) ) {
258
+ $script_handle = 'vidbgpro';
259
+ } else {
260
+ $script_handle = 'vidbg-video-background';
261
+ }
262
+
263
+ // Add our "container to row" script
264
+ wp_add_inline_script( $script_handle, $add_container_to_row );
265
+
266
+ // Construct the shortcode with our attributes
267
+ // Check if plugin is Video Background Pro or Video Background
268
+ if ( function_exists( 'vidbgpro_construct_shortcode' ) ) {
269
+ $shortcode = vidbgpro_construct_shortcode( $this->vidbg_atts );
270
+ } else {
271
+ $shortcode = vidbg_construct_shortcode( $this->vidbg_atts );
272
+ }
273
+
274
+ // Output the shortcode
275
+ $output = do_shortcode( $shortcode );
276
+ $output .= '<div class="' . $unique_class . '" style="display: none;"></div>';
277
+
278
+ return $output;
279
+ }
280
+
281
+ }
282
+
283
+ // Call the class
284
+ $vidbg_init_siteorigin = new Vidbg_SiteOrigin();
285
+ }
inc/classes/vidbg_wpbakery.php ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Video Background's class to add a video background to a WP Bakery (Visual Composer) row
5
+ *
6
+ * @author Push Labs https://pushlabs.co
7
+ * @copyright Copyright (c) Push Labs (hello@pushlabs.co)
8
+ * @since 2.7.0
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ if ( ! class_exists( 'Vidbg_WPBakery' ) ) {
16
+ /**
17
+ * WP Bakery Integration
18
+ *
19
+ * @package Video Background/Video Background Pro
20
+ * @author Push Labs
21
+ * @version 1.0.0
22
+ */
23
+ class Vidbg_WPBakery {
24
+
25
+ // Class' properties
26
+ private $prefix;
27
+ protected $vidbg_atts;
28
+
29
+
30
+ public function __construct( $vc_row_atts = null ) {
31
+ // Get the VC Row's attributes
32
+ $this->vc_row_atts = $vc_row_atts;
33
+
34
+ // vidbg_atts will hold our [vidbg] shortcode attributes
35
+ $this->vidbg_atts = array();
36
+
37
+ // The data prefix for the attributes we'll add to Visual Composer
38
+ $this->prefix = 'vidbg_vc_';
39
+
40
+ // Add our attributes to the VC row
41
+ add_action( 'vc_before_init', array( $this, 'register_fields' ) );
42
+ }
43
+
44
+ /**
45
+ * Define and add our attributes to the VC Row
46
+ *
47
+ * @since 2.7.0
48
+ */
49
+ public function register_fields() {
50
+ // Define our attributes
51
+ $attributes = array(
52
+ array(
53
+ 'type' => 'textfield',
54
+ 'heading' => __( 'Link to .mp4', 'video-background' ),
55
+ 'param_name' => $this->prefix . 'mp4',
56
+ 'description' => __( 'Please specify the link to the .mp4 file.', 'video-background' ),
57
+ 'dependency' => array(
58
+ 'element' => $this->prefix . 'type',
59
+ 'value' => 'self-host',
60
+ ),
61
+ 'group' => __( 'Video Background', 'video-background' ),
62
+ 'weight' => -10,
63
+ ),
64
+ array(
65
+ 'type' => 'textfield',
66
+ 'heading' => __( 'Link to .webm', 'video-background' ),
67
+ 'param_name' => $this->prefix . 'webm',
68
+ 'description' => __( 'Please specify the link to the .webm file.', 'video-background' ),
69
+ 'dependency' => array(
70
+ 'element' => $this->prefix . 'type',
71
+ 'value' => 'self-host',
72
+ ),
73
+ 'group' => __( 'Video Background', 'video-background' ),
74
+ 'weight' => -20,
75
+ ),
76
+ array(
77
+ 'type' => 'attach_image',
78
+ 'heading' => __( 'Fallback Image', 'video-background' ),
79
+ 'param_name' => $this->prefix . 'poster',
80
+ 'description' => __( 'Please upload a fallback image.', 'video-background' ),
81
+ 'group' => __( 'Video Background', 'video-background' ),
82
+ 'weight' => -30,
83
+ ),
84
+ array(
85
+ 'type' => 'checkbox',
86
+ 'heading' => __( 'Enable Overlay?', 'video-background' ),
87
+ 'param_name' => $this->prefix . 'overlay',
88
+ 'description' => __( 'Add an overlay over the video. This is useful if your text isn\'t readable with a video background.', 'video-background' ),
89
+ 'group' => __( 'Video Background', 'video-background' ),
90
+ 'value' => '0',
91
+ 'weight' => -40,
92
+ ),
93
+ array(
94
+ 'type' => 'colorpicker',
95
+ 'heading' => __( 'Overlay Color', 'video-background' ),
96
+ 'param_name' => $this->prefix . 'overlay_color',
97
+ 'value' => '#000',
98
+ 'description' => __( 'If overlay is enabled, a color will be used for the overlay. You can specify the color here.', 'video-background' ),
99
+ 'dependency' => array(
100
+ 'element' => $this->prefix . 'overlay',
101
+ 'value' => 'true',
102
+ ),
103
+ 'group' => __( 'Video Background', 'video-background' ),
104
+ 'weight' => -50,
105
+ ),
106
+ array(
107
+ 'type' => 'textfield',
108
+ 'heading' => __( 'Overlay Opacity', 'video-background' ),
109
+ 'param_name' => $this->prefix . 'overlay_alpha',
110
+ 'value' => '0.3',
111
+ 'description' => __( 'Specify the opacity of the overlay. Accepts any value between 0.00-1.00 with 0 being completely transparent and 1 being completely invisible. Ex. 0.30', 'video-background' ),
112
+ 'dependency' => array(
113
+ 'element' => $this->prefix . 'overlay',
114
+ 'value' => 'true',
115
+ ),
116
+ 'group' => __( 'Video Background', 'video-background' ),
117
+ 'weight' => -60,
118
+ ),
119
+ array(
120
+ 'type' => 'checkbox',
121
+ 'heading' => __( 'Disable Loop?', 'video-background' ),
122
+ 'param_name' => $this->prefix . 'loop',
123
+ 'description' => __( 'Turn off the loop for Video Background. Once the video is complete, it will display the last frame of the video.', 'video-background' ),
124
+ 'group' => __( 'Video Background', 'video-background' ),
125
+ 'value' => '0',
126
+ 'weight' => -70,
127
+ ),
128
+ );
129
+
130
+ // Only add tap to unmute if is not Video Background Pro
131
+ if ( ! function_exists( 'vidbgpro_install_plugin' ) ) {
132
+ $attributes[] = array(
133
+ 'type' => 'checkbox',
134
+ 'heading' => __( 'Display "Tap to unmute" button?', 'video-background' ),
135
+ 'param_name' => $this->prefix . 'tap_to_unmute',
136
+ 'description' => __( 'Allow your users to interact with the sound of the video background.', 'video-background' ),
137
+ 'group' => __( 'Video Background', 'video-background' ),
138
+ 'value' => '0',
139
+ 'weight' => -80,
140
+ );
141
+ }
142
+
143
+ $attributes = apply_filters( 'vidbg_wpbakery_fields', $attributes );
144
+
145
+ // Add the params to the VC row
146
+ vc_add_params( 'vc_row', $attributes );
147
+ }
148
+
149
+ /**
150
+ * Find all attributes with the prefix and add them to the $vidbg_atts array
151
+ *
152
+ * @since 2.7.0
153
+ */
154
+ public function get_vidbg_attributes() {
155
+ // If the class doesn't have a VC Row atts arg, don't run the function
156
+ if ( $this->vc_row_atts === null ) {
157
+ return;
158
+ }
159
+
160
+ // Run a foreach loop on the VC Row atts
161
+ foreach ( $this->vc_row_atts as $attribute_key => $attribute ) {
162
+ // Find the attributes with the $prefix
163
+ if ( substr( $attribute_key, 0, strlen( $this->prefix ) ) === $this->prefix ) {
164
+ // Remove the $prefix
165
+ $attribute_key = substr( $attribute_key, strlen( $this->prefix ) );
166
+
167
+ // If the attribute is the poster, get the image source of the attribute ID, otherwise get the attribute
168
+ if ( $attribute_key === 'poster' ) {
169
+ $img_src_arr = wp_get_attachment_image_src( $attribute, 'full' );
170
+ $this->vidbg_atts[$attribute_key] = $img_src_arr[0];
171
+ } else {
172
+ $this->vidbg_atts[$attribute_key] = $attribute;
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Generate the shortcode for the frontend
180
+ *
181
+ * @since 2.7.0
182
+ */
183
+ public function generate_shortcode() {
184
+ // If the class doesn't have a VC Row atts arg, don't run the function
185
+ if ( $this->vc_row_atts === null ) {
186
+ return;
187
+ }
188
+
189
+ // Get the Video Background attributes in the VC Row
190
+ $this->get_vidbg_attributes();
191
+
192
+ // Conditionally determine if the row has a video background
193
+ if ( function_exists( 'vidbgpro_install_plugin' ) ) {
194
+ // If plugin is Video Background Pro
195
+
196
+ // If type is YouTube and YouTube URL param is empty, quit
197
+ if ( isset( $this->vidbg_atts['type'] ) && ! isset( $this->vidbg_atts['youtube_url'] ) ) {
198
+ return;
199
+ }
200
+
201
+ // If type is self-host and mp4 amd webm param are both empty, quit
202
+ if ( ! isset( $this->vidbg_atts['type'] ) && ! isset( $this->vidbg_atts['mp4'] ) && ! isset( $this->vidbg_atts['webm'] ) ) {
203
+ return;
204
+ }
205
+ } else {
206
+ // If plugin is Video Background
207
+
208
+ // If mp4 and webm params are empty, quit
209
+ if ( ! isset( $this->vidbg_atts['mp4'] ) && ! isset( $this->vidbg_atts['webm'] ) ) {
210
+ return;
211
+ }
212
+ }
213
+
214
+ // Debug Visual Composer row attributes
215
+ // var_dump( $this->vc_row_atts );
216
+
217
+ if ( array_key_exists( 'loop', $this->vidbg_atts ) ) {
218
+ $this->vidbg_atts['loop'] = $this->vidbg_atts['loop'] === 'false' ? 'true' : 'false';
219
+ }
220
+
221
+ $this->vidbg_atts = apply_filters( 'vidbg_sanitize_wpbakery_fields', $this->vidbg_atts );
222
+
223
+ // Create our container selector
224
+ // Check if plugin is Video Background Pro or Video Background
225
+ if ( function_exists( 'vidbgpro_create_unique_ref' ) ) {
226
+ $unique_class = vidbgpro_create_unique_ref();
227
+ } else {
228
+ $unique_class = vidbg_create_unique_ref();
229
+ }
230
+
231
+ $container_class = $unique_class . '-container';
232
+
233
+ // Add our class to the shortcode atts array
234
+ $this->vidbg_atts['container'] = '.' . $container_class;
235
+
236
+ // Add our source to the shortcode atts array
237
+ $this->vidbg_atts['source'] = 'WPBakery Integration';
238
+
239
+ // Use to test the attributes created for $vidbg_atts
240
+ // var_dump( $this->vidbg_atts );
241
+
242
+ // Our jQuery code to add the container class to the container so we can target the VC Row
243
+ $add_container_to_row = "
244
+ jQuery(function($){
245
+ $('." . $unique_class . "').next('.vc_row').addClass('" . $container_class . "');
246
+ });
247
+ ";
248
+
249
+ if ( function_exists( 'vidbgpro_install_plugin' ) ) {
250
+ $script_handle = 'vidbgpro';
251
+ } else {
252
+ $script_handle = 'vidbg-video-background';
253
+ }
254
+
255
+ // Add our "container to row" script
256
+ wp_add_inline_script( $script_handle, $add_container_to_row );
257
+
258
+ // Construct the shortcode with our attributes
259
+ // Check if plugin is Video Background Pro or Video Background
260
+ if ( function_exists( 'vidbgpro_construct_shortcode' ) ) {
261
+ $shortcode = vidbgpro_construct_shortcode( $this->vidbg_atts );
262
+ } else {
263
+ $shortcode = vidbg_construct_shortcode( $this->vidbg_atts );
264
+ }
265
+
266
+ // Output the shortcode
267
+ $output = do_shortcode( $shortcode );
268
+ $output .= '<div class="' . $unique_class . '" style="display: none;"></div>';
269
+
270
+ return $output;
271
+ }
272
+ }
273
+
274
+ // Call our class to init the VC Row fields
275
+ $vidbg_init_wpbakery = new Vidbg_WPBakery();
276
+
277
+ // vc_theme_before_vc_row allows us to add content before a Visual Composer Row
278
+ if ( !function_exists( 'vc_theme_before_vc_row' ) ) {
279
+ /**
280
+ * Add the shortcode and unique class before the Visual Composer row
281
+ *
282
+ * @since 2.7.0
283
+ */
284
+ function vc_theme_before_vc_row($atts, $content = null) {
285
+ // Create an instance of the class with the VC row's $atts
286
+ $vidbg_init_wpbakery_row = new Vidbg_WPBakery( $atts );
287
+
288
+ // Return the generated shortcode
289
+ return $vidbg_init_wpbakery_row->generate_shortcode();
290
+ }
291
+ }
292
+ }
js/vidbg.js CHANGED
@@ -10,9 +10,6 @@
10
  // to reference this class from internal events and functions.
11
  var base = this;
12
 
13
- // Not implemented message
14
- var NOT_IMPLEMENTED_MSG = 'Not implemented';
15
-
16
  // Access to jQuery and DOM versions of element
17
  base.$el = $(el);
18
  base.el = el;
@@ -54,6 +51,9 @@
54
  // Display our self hosted video if applicable
55
  base.selfHostVideo();
56
 
 
 
 
57
  // Add our overlay to be initialized
58
  base.overlay();
59
  };
@@ -123,14 +123,41 @@
123
 
124
  // Add the vidbg overlay to the container
125
  $container.append( $overlay );
126
-
127
  };
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  /**
130
  * The function to display the poster fallback
131
  * @public
132
  */
133
- base.displayPoster = function() {
134
  // Declare our variables
135
  var $container = base.$container;
136
 
@@ -138,6 +165,11 @@
138
  return;
139
  }
140
 
 
 
 
 
 
141
  // If VB is mobile, display the poster image
142
  if ( base.isMobile() === true ) {
143
  $container.css( 'background-image', 'url(' + base.options.poster + ')' );
@@ -182,7 +214,19 @@
182
  defaultPlaybackRate: 1,
183
  });
184
  } catch (e) {
185
- throw new Error(NOT_IMPLEMENTED_MSG);
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
  // Size the video accordingly to its container
@@ -258,22 +302,15 @@
258
  mp4: '#', // The mp4 link if type is set to self-host
259
  webm: '#', // The webm link if type is set to self-host
260
  poster: '#', // The fallback image if on mobile
261
- mute: true, // Video mute
 
 
262
  repeat: true, // Video loop
263
  overlay: false, // The video overlay
264
  overlayColor: '#000', // The default overlay color if enabled
265
  overlayAlpha: '0.3', // The default overlay transparancy if enabled
266
  };
267
 
268
- /**
269
- * An object for keeping track of instances
270
- * @public
271
- * @type {Object}
272
- */
273
- $.vidbg.instanceCollection = {
274
- instance: []
275
- };
276
-
277
  /**
278
  * Create the plugin and instances
279
  * @param {Ojbect|String} options
@@ -281,35 +318,18 @@
281
  * @constructor
282
  */
283
  $.fn.vidbg = function(options){
284
- return this.each(function(){
285
- // Get the plugin data
286
- var instance = $.data( this, 'vidbg' );
287
-
288
- // Create the instance
289
- instance = new $.vidbg( this, options );
290
- instance.index = $.vidbg.instanceCollection.instance.push( instance ) - 1;
291
- $.data( this, 'vidbg', instance );
292
- });
293
- };
294
 
295
- /**
296
- * Our Ready function
297
- * Resize will go here for each instance
298
- */
299
- $( document ).ready( function() {
300
- var $window = $(window);
301
 
302
- // Resize the video backgrounds
303
- $window.on( 'resize.vidbg', function() {
304
- for ( var len = $.vidbg.instanceCollection.instance.length, i = 0, instance; i < len; i++ ) {
305
- instance = $.vidbg.instanceCollection.instance[i];
306
-
307
- if ( instance ) {
308
- instance.resize();
309
- }
310
- }
311
  });
312
 
313
- });
314
 
315
  })(jQuery);
10
  // to reference this class from internal events and functions.
11
  var base = this;
12
 
 
 
 
13
  // Access to jQuery and DOM versions of element
14
  base.$el = $(el);
15
  base.el = el;
51
  // Display our self hosted video if applicable
52
  base.selfHostVideo();
53
 
54
+ //
55
+ base.tapToUnmute();
56
+
57
  // Add our overlay to be initialized
58
  base.overlay();
59
  };
123
 
124
  // Add the vidbg overlay to the container
125
  $container.append( $overlay );
 
126
  };
127
 
128
+ /**
129
+ * The function to display the tap to unmute button
130
+ * @public
131
+ */
132
+ base.tapToUnmute = function() {
133
+
134
+ // If the tap to unmute option is disabled, quit.
135
+ if ( base.options.tapToUnmute === false ) {
136
+ return;
137
+ }
138
+
139
+ // Create the tap to unmute button
140
+ var $tapToUnmuteButton = base.$tapToUnmuteButton = $( '<div class="vidbg-tap-to-unmute">' + base.options.tapToUnmuteText + '</div>' );
141
+
142
+ // On click unmute the video and remove the button
143
+ $tapToUnmuteButton.on( 'click', function( event ) {
144
+ event.preventDefault();
145
+
146
+ base.$selfHostVideo.prop( 'muted', false );
147
+
148
+ this.remove();
149
+ });
150
+
151
+ // Add the tap to unmute button to the element
152
+ // The button is added outside the .vidbg-container due to the negative z-index.
153
+ base.$el.append( $tapToUnmuteButton );
154
+ }
155
+
156
  /**
157
  * The function to display the poster fallback
158
  * @public
159
  */
160
+ base.displayPoster = function( forcePoster ) {
161
  // Declare our variables
162
  var $container = base.$container;
163
 
165
  return;
166
  }
167
 
168
+ // If the forcePoster param is set to true, force the container
169
+ if ( forcePoster === true ) {
170
+ $container.css( 'background-image', 'url(' + base.options.poster + ')' );
171
+ }
172
+
173
  // If VB is mobile, display the poster image
174
  if ( base.isMobile() === true ) {
175
  $container.css( 'background-image', 'url(' + base.options.poster + ')' );
214
  defaultPlaybackRate: 1,
215
  });
216
  } catch (e) {
217
+ console.log( 'error' );
218
+ }
219
+
220
+ var playPromise = $selfHostVideo.get(0).play();
221
+
222
+ if (playPromise !== undefined) {
223
+ playPromise.then(function() {
224
+ // Autoplay succeed
225
+ }).catch(function(error) {
226
+ // The browser doesn't allow video backgrounds to be played with audio, show fallback
227
+ // Autoplay failed
228
+ base.displayPoster( true );
229
+ });
230
  }
231
 
232
  // Size the video accordingly to its container
302
  mp4: '#', // The mp4 link if type is set to self-host
303
  webm: '#', // The webm link if type is set to self-host
304
  poster: '#', // The fallback image if on mobile
305
+ mute: true, // Video mute (Depreciated due to autoplay restrictions)
306
+ tapToUnmute: false, // Tap to Unmute button
307
+ tapToUnmuteText: 'Tap to unmute', // Tap to unmute text
308
  repeat: true, // Video loop
309
  overlay: false, // The video overlay
310
  overlayColor: '#000', // The default overlay color if enabled
311
  overlayAlpha: '0.3', // The default overlay transparancy if enabled
312
  };
313
 
 
 
 
 
 
 
 
 
 
314
  /**
315
  * Create the plugin and instances
316
  * @param {Ojbect|String} options
318
  * @constructor
319
  */
320
  $.fn.vidbg = function(options){
 
 
 
 
 
 
 
 
 
 
321
 
322
+ return this.each( function() {
323
+ // Create the plugin instance and reference
324
+ var plugin = new $.vidbg( this, options );
325
+ $( this ).data( 'vidbg', plugin );
 
 
326
 
327
+ // If window is resized, resize the plugin instance
328
+ $( window ).resize( function() {
329
+ plugin.resize();
330
+ })
 
 
 
 
 
331
  });
332
 
333
+ };
334
 
335
  })(jQuery);
js/vidbg.min.js CHANGED
@@ -3,4 +3,4 @@
3
  * Copyright 2017 Push Labs
4
  * @preserve
5
  */
6
- !function($){$.vidbg=function(o,i){function e(o){var i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;o=o.replace(i,function(o,i,e,t){return i+i+e+e+t+t});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}var t=this,n="Not implemented";t.$el=$(o),t.el=o,t.$el.data("vidbg",t),t.init=function(){t.options=$.extend({},$.vidbg.defaultOptions,i),t.container(),t.displayPoster(),t.selfHostVideo(),t.overlay()},t.isMobile=function(){return!!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)},t.container=function(){var o=t.$container=$('<div class="vidbg-container">');"static"===t.$el.css("position")&&t.$el.css("position","relative"),t.$el.css("z-index","1"),$(t.$el).prepend(o),t.$el.is("body")&&o.css({position:"fixed"})},t.overlay=function(){var o=t.$container,i=t.$overlay=$('<div class="vidbg-overlay">');!0===t.options.overlay&&i.css({background:"rgba("+e(t.options.overlayColor).r+", "+e(t.options.overlayColor).g+", "+e(t.options.overlayColor).b+", "+t.options.overlayAlpha+")"}),o.append(i)},t.displayPoster=function(){var o=t.$container;"#"!==t.options.poster&&(!0===t.isMobile()?o.css("background-image","url("+t.options.poster+")"):"#"===t.options.mp4&&"#"===t.options.webm&&o.css("background-image","url("+t.options.poster+")"))},t.selfHostVideo=function(){if(!0!==t.isMobile()&&("#"!==t.options.mp4||"#"!==t.options.webm)){var o=t.$container,i=t.$selfHostVideo=$('<video playsinline><source src="'+t.options.mp4+'" type="video/mp4"><source src="'+t.options.webm+'" type="video/webm"></video>');try{i.prop({autoplay:!0,loop:t.options.repeat,volume:1,muted:t.options.mute,defaultMuted:t.options.mute,playbackRate:1,defaultPlaybackRate:1})}catch(o){throw new Error("Not implemented")}i.one("canplaythrough.vidbg",function(){t.resize()}),i.one("playing.vidbg",function(){i.css({opacity:1})}),o.append(i)}},t.resize=function(){if(!0!==t.isMobile()&&("#"!==t.options.mp4||"#"!==t.options.webm)){var o=t.$container,i=o.outerHeight(),e=o.outerWidth(),n;n=t.$selfHostVideo;var a,s;a=n[0].videoHeight,s=n[0].videoWidth,e/s>i/a?n.css({width:e+2,height:"auto"}):n.css({width:"auto",height:i+2})}},t.init()},$.vidbg.defaultOptions={mp4:"#",webm:"#",poster:"#",mute:!0,repeat:!0,overlay:!1,overlayColor:"#000",overlayAlpha:"0.3"},$.vidbg.instanceCollection={instance:[]},$.fn.vidbg=function(o){return this.each(function(){var i=$.data(this,"vidbg");i=new $.vidbg(this,o),i.index=$.vidbg.instanceCollection.instance.push(i)-1,$.data(this,"vidbg",i)})},$(document).ready(function(){$(window).on("resize.vidbg",function(){for(var o=$.vidbg.instanceCollection.instance.length,i=0,e;i<o;i++)(e=$.vidbg.instanceCollection.instance[i])&&e.resize()})})}(jQuery);
3
  * Copyright 2017 Push Labs
4
  * @preserve
5
  */
6
+ !function($){$.vidbg=function(o,e){function t(o){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;o=o.replace(e,function(o,e,t,i){return e+e+t+t+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}var i=this;i.$el=$(o),i.el=o,i.$el.data("vidbg",i),i.init=function(){i.options=$.extend({},$.vidbg.defaultOptions,e),i.container(),i.displayPoster(),i.selfHostVideo(),i.tapToUnmute(),i.overlay()},i.isMobile=function(){return!!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)},i.container=function(){var o=i.$container=$('<div class="vidbg-container">');"static"===i.$el.css("position")&&i.$el.css("position","relative"),i.$el.css("z-index","1"),$(i.$el).prepend(o),i.$el.is("body")&&o.css({position:"fixed"})},i.overlay=function(){var o=i.$container,e=i.$overlay=$('<div class="vidbg-overlay">');!0===i.options.overlay&&e.css({background:"rgba("+t(i.options.overlayColor).r+", "+t(i.options.overlayColor).g+", "+t(i.options.overlayColor).b+", "+i.options.overlayAlpha+")"}),o.append(e)},i.tapToUnmute=function(){if(!1!==i.options.tapToUnmute){var o=i.$tapToUnmuteButton=$('<div class="vidbg-tap-to-unmute">'+i.options.tapToUnmuteText+"</div>");o.on("click",function(o){o.preventDefault(),i.$selfHostVideo.prop("muted",!1),this.remove()}),i.$el.append(o)}},i.displayPoster=function(o){var e=i.$container;"#"!==i.options.poster&&(!0===o&&e.css("background-image","url("+i.options.poster+")"),!0===i.isMobile()?e.css("background-image","url("+i.options.poster+")"):"#"===i.options.mp4&&"#"===i.options.webm&&e.css("background-image","url("+i.options.poster+")"))},i.selfHostVideo=function(){if(!0!==i.isMobile()&&("#"!==i.options.mp4||"#"!==i.options.webm)){var o=i.$container,e=i.$selfHostVideo=$('<video playsinline><source src="'+i.options.mp4+'" type="video/mp4"><source src="'+i.options.webm+'" type="video/webm"></video>');try{e.prop({autoplay:!0,loop:i.options.repeat,volume:1,muted:i.options.mute,defaultMuted:i.options.mute,playbackRate:1,defaultPlaybackRate:1})}catch(o){console.log("error")}var t=e.get(0).play();void 0!==t&&t.then(function(){}).catch(function(o){i.displayPoster(!0)}),e.one("canplaythrough.vidbg",function(){i.resize()}),e.one("playing.vidbg",function(){e.css({opacity:1})}),o.append(e)}},i.resize=function(){if(!0!==i.isMobile()&&("#"!==i.options.mp4||"#"!==i.options.webm)){var o=i.$container,e=o.outerHeight(),t=o.outerWidth(),n;n=i.$selfHostVideo;var a,s;a=n[0].videoHeight,s=n[0].videoWidth,t/s>e/a?n.css({width:t+2,height:"auto"}):n.css({width:"auto",height:e+2})}},i.init()},$.vidbg.defaultOptions={mp4:"#",webm:"#",poster:"#",mute:!0,tapToUnmute:!1,tapToUnmuteText:"Tap to unmute",repeat:!0,overlay:!1,overlayColor:"#000",overlayAlpha:"0.3"},$.fn.vidbg=function(o){return this.each(function(){var e=new $.vidbg(this,o);$(this).data("vidbg",e),$(window).resize(function(){e.resize()})})}}(jQuery);
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: 2017-09-26 15:18-0700\n"
7
  "PO-Revision-Date: 2016-03-30 22:31-0700\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
@@ -27,355 +27,293 @@ msgid ""
27
  "\" target=\"_blank\">Check out Video Background Pro</a>"
28
  msgstr ""
29
 
30
- #: candide-vidbg.php:100
31
  msgid "Show Advanced Options"
32
  msgstr ""
33
 
34
- #: candide-vidbg.php:101
35
  msgid "Hide Advanced Options"
36
  msgstr ""
37
 
38
  #. Plugin Name of the plugin/theme
39
- #: candide-vidbg.php:236
 
 
 
 
40
  msgid "Video Background"
41
  msgstr ""
42
 
43
- #: candide-vidbg.php:243
44
  msgid "Container"
45
  msgstr ""
46
 
47
- #: candide-vidbg.php:244
48
  msgid ""
49
- "Please specify the container you would like your video background to be in."
50
- "<br>ex: <code>.header</code> or <code>body</code>"
 
51
  msgstr ""
52
 
53
- #: candide-vidbg.php:248
54
- msgid "YouTube Link"
55
- msgstr ""
56
-
57
- #: candide-vidbg.php:251
58
- msgid ""
59
- "To create YouTube video backgrounds, <a href=\"http://pushlabs.co/video-"
60
- "background-pro\" rel=\"nofollow\" target=\"_blank\">please download the pro "
61
- "version!</a>"
62
- msgstr ""
63
-
64
- #: candide-vidbg.php:253
65
- msgid "YouTube Start Second"
66
- msgstr ""
67
-
68
- #: candide-vidbg.php:256
69
- msgid ""
70
- "To use the YouTube Start Second feature, <a href=\"http://pushlabs.co/video-"
71
- "background-pro\" rel=\"nofollow\" target=\"_blank\">please download the pro "
72
- "version!</a>"
73
- msgstr ""
74
-
75
- #: candide-vidbg.php:258
76
- msgid "YouTube End Second"
77
- msgstr ""
78
-
79
- #: candide-vidbg.php:261
80
- msgid ""
81
- "To use the YouTube End Second feature, <a href=\"http://pushlabs.co/video-"
82
- "background-pro\" rel=\"nofollow\" target=\"_blank\">please download the pro "
83
- "version!</a>"
84
- msgstr ""
85
-
86
- #: candide-vidbg.php:266
87
  msgid "Link to .mp4"
88
  msgstr ""
89
 
90
- #: candide-vidbg.php:267
91
  msgid ""
92
  "Please specify the link to the .mp4 file. You can either enter a URL or "
93
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
94
  "file for video backgrounds."
95
  msgstr ""
96
 
97
- #: candide-vidbg.php:271
98
  msgid "Upload .mp4 file"
99
  msgstr ""
100
 
101
- #: candide-vidbg.php:276
 
102
  msgid "Link to .webm"
103
  msgstr ""
104
 
105
- #: candide-vidbg.php:277
106
  msgid ""
107
  "Please specify the link to the .webm file. You can either enter a URL or "
108
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
109
  "file for video backgrounds."
110
  msgstr ""
111
 
112
- #: candide-vidbg.php:281
113
  msgid "Upload .webm file"
114
  msgstr ""
115
 
116
- #: candide-vidbg.php:286
117
  msgid "Link to fallback image"
118
  msgstr ""
119
 
120
- #: candide-vidbg.php:287
121
  msgid ""
122
  "Please specify a link to the fallback image in case the browser does not "
123
  "support video backgrounds. You can either enter a URL or upload a file."
124
  msgstr ""
125
 
126
- #: candide-vidbg.php:291
127
  msgid "Upload fallback image"
128
  msgstr ""
129
 
130
- #: candide-vidbg.php:296
131
  msgid "Overlay"
132
  msgstr ""
133
 
134
- #: candide-vidbg.php:297
 
135
  msgid ""
136
  "Add an overlay over the video. This is useful if your text isn't readable "
137
  "with a video background."
138
  msgstr ""
139
 
140
- #: candide-vidbg.php:302 candide-vidbg.php:339 candide-vidbg.php:362
141
  msgid "Off"
142
  msgstr ""
143
 
144
- #: candide-vidbg.php:303 candide-vidbg.php:340 candide-vidbg.php:363
145
  msgid "On"
146
  msgstr ""
147
 
148
- #: candide-vidbg.php:309
 
149
  msgid "Overlay Color"
150
  msgstr ""
151
 
152
- #: candide-vidbg.php:310
 
153
  msgid ""
154
  "If overlay is enabled, a color will be used for the overlay. You can specify "
155
  "the color here."
156
  msgstr ""
157
 
158
- #: candide-vidbg.php:317
 
159
  msgid "Overlay Opacity"
160
  msgstr ""
161
 
162
- #: candide-vidbg.php:318
163
  msgid ""
164
  "Specify the opacity of the overlay with the left being mostly transparent "
165
  "and the right being hardly transparent."
166
  msgstr ""
167
 
168
- #: candide-vidbg.php:325
169
- msgid "Overlay Texture"
170
- msgstr ""
171
-
172
- #: candide-vidbg.php:328
173
- msgid ""
174
- "To add overlay textures to your video background, <a href=\"http://pushlabs."
175
- "co/video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
176
- "the pro version!</a>"
177
- msgstr ""
178
-
179
- #: candide-vidbg.php:333
180
  msgid "Turn off loop?"
181
  msgstr ""
182
 
183
- #: candide-vidbg.php:334
 
184
  msgid ""
185
  "Turn off the loop for Video Background. Once the video is complete, it will "
186
  "display the last frame of the video."
187
  msgstr ""
188
 
189
- #: candide-vidbg.php:343
190
- msgid "End video on fallback image?"
191
- msgstr ""
192
-
193
- #: candide-vidbg.php:346
194
- msgid ""
195
- "To enable the end video on fallback image feature, <a href=\"http://pushlabs."
196
- "co/video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
197
- "the pro version!</a>"
198
- msgstr ""
199
-
200
- #: candide-vidbg.php:348
201
- msgid "Enable CSS loader?"
202
  msgstr ""
203
 
204
- #: candide-vidbg.php:351
205
  msgid ""
206
- "To enable the CSS loader feature, <a href=\"http://pushlabs.co/video-"
207
- "background-pro\" rel=\"nofollow\" target=\"_blank\">please download the pro "
208
- "version!</a>"
209
  msgstr ""
210
 
211
- #: candide-vidbg.php:356
212
- msgid "Play the audio?"
213
- msgstr ""
214
-
215
- #: candide-vidbg.php:357
216
- msgid "Enabling this will play the audio of the video."
217
- msgstr ""
218
-
219
- #: candide-vidbg.php:366
220
- msgid "Enable Play/Pause button"
221
- msgstr ""
222
-
223
- #: candide-vidbg.php:369
224
- msgid ""
225
- "To enable a play/pause button on the frontend, <a href=\"http://pushlabs.co/"
226
- "video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
227
- "the pro version!</a>"
228
- msgstr ""
229
-
230
- #: candide-vidbg.php:371
231
- msgid "Enable Mute/Unmute button"
232
- msgstr ""
233
-
234
- #: candide-vidbg.php:374
235
- msgid ""
236
- "To enable a mute/unmute button on the frontend, <a href=\"http://pushlabs.co/"
237
- "video-background-pro\" rel=\"nofollow\" target=\"_blank\">please download "
238
- "the pro version!</a>"
239
- msgstr ""
240
-
241
- #: candide-vidbg.php:379
242
  msgid ""
243
  "<a href=\"#vidbg_advanced_options\" class=\"button vidbg-button advanced-"
244
  "options-button\">Show Advanced options</a>"
245
  msgstr ""
246
 
247
- #: candide-vidbg.php:530 candide-vidbg.php:537
248
- msgid "Hide Muted Pro Fields"
249
- msgstr ""
250
-
251
- #: candide-vidbg.php:575
252
- msgid ""
253
- "Okay, Okay, some of you don't want/need Video Background Pro. I get that. "
254
- "That's why you can hide the muted pro fields below :)"
255
  msgstr ""
256
 
257
- #: candide-vidbg.php:590
258
  msgid "<h2>Video Background</h2>"
259
  msgstr ""
260
 
261
- #: candide-vidbg.php:591
262
  msgid ""
263
  "<p>Video background makes it easy to add responsive, great looking video "
264
  "backgrounds to any element on your website.</p>"
265
  msgstr ""
266
 
267
- #: candide-vidbg.php:592
268
  msgid "<h3>Getting Started</h3>"
269
  msgstr ""
270
 
271
- #: candide-vidbg.php:593
272
- msgid ""
273
- "<p>To implement Video Background on your website, please follow the "
274
- "instructions below."
275
  msgstr ""
276
 
277
- #: candide-vidbg.php:595
278
- msgid ""
279
- "<li>Edit the page or post you would like the video background to appear on.</"
280
- "li>"
281
  msgstr ""
282
 
283
- #: candide-vidbg.php:596
284
- msgid ""
285
- "<li>Below the content editor, you should see a metabox titled <b>Video "
286
- "Background</b>. Enter the values for the required fields and publish/update "
287
- "the page.</li>"
288
  msgstr ""
289
 
290
- #: candide-vidbg.php:597
291
- msgid "<li>Enjoy.</li>"
292
  msgstr ""
293
 
294
- #: candide-vidbg.php:599
295
- msgid ""
296
- "<p>Alternatively, you can use the shortcode by placing the following code at "
297
- "the bottom of the content editor of the page or post you would like the "
298
- "video background to appear on. Here is how it works:</p>"
299
  msgstr ""
300
 
301
- #: candide-vidbg.php:601
302
  msgid ""
303
  "<a href=\"https://pushlabs.co/docs/video-background/\" class=\"button\" "
304
  "target=\"_blank\">Further Documentation</a>"
305
  msgstr ""
306
 
307
- #: candide-vidbg.php:602
308
  msgid "<h3>Questions?</h3>"
309
  msgstr ""
310
 
311
- #: candide-vidbg.php:603
312
  msgid ""
313
  "<p>If you have any feedback/questions regarding the plugin you can reach me "
314
  "<a href=\"https://wordpress.org/support/plugin/video-background\" target="
315
  "\"_blank\">here.</a>"
316
  msgstr ""
317
 
318
- #: candide-vidbg.php:604
319
  msgid "<h3>Supporting the Plugin</h3>"
320
  msgstr ""
321
 
322
- #: candide-vidbg.php:605
323
  msgid ""
324
  "<p>If you like Video Background and want to show your support, consider "
325
- "purchasing the <a href=\"http://pushlabs.co/video-background-pro\" rel="
326
- "\"nofollow\" target=\"_blank\">pro version</a>. It comes with plenty of "
327
- "helpful features that make your life easier like:</p>"
328
  msgstr ""
329
 
330
- #: candide-vidbg.php:607
331
  msgid "<li>Mobile video background playback on supported browsers</li>"
332
  msgstr ""
333
 
334
- #: candide-vidbg.php:608
335
  msgid "<li>YouTube Integration</li>"
336
  msgstr ""
337
 
338
- #: candide-vidbg.php:609
339
- msgid "<li>Visual Composer Integration</li>"
340
- msgstr ""
341
-
342
- #: candide-vidbg.php:610
343
- msgid "<li>Page Builder by SiteOrigin Integration</li>"
344
- msgstr ""
345
-
346
- #: candide-vidbg.php:611
347
  msgid "<li>Frontend Play/Pause Button Option</li>"
348
  msgstr ""
349
 
350
- #: candide-vidbg.php:612
351
  msgid "<li>Frontend Volume Button Option</li>"
352
  msgstr ""
353
 
354
- #: candide-vidbg.php:613
355
  msgid "<li>Overlay Image Textures</li>"
356
  msgstr ""
357
 
358
- #: candide-vidbg.php:614
359
  msgid "<li>Extensive Documentation</li>"
360
  msgstr ""
361
 
362
- #: candide-vidbg.php:615
363
  msgid "<li>Video Tutorials</li>"
364
  msgstr ""
365
 
366
- #: candide-vidbg.php:616
367
  msgid "<li>And Much More!</li>"
368
  msgstr ""
369
 
370
- #: candide-vidbg.php:618
371
  msgid ""
372
  "<a href=\"http://pushlabs.co/video-background-pro\" class=\"button button-"
373
  "primary\" rel=\"nofollow\" target=\"_blank\">Learn More About Video "
374
  "Background Pro</a>"
375
  msgstr ""
376
 
377
- #: candide-vidbg.php:635
378
- msgid "<a href=\"options-general.php?page=html5-vidbg\">Getting Started</a>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  msgstr ""
380
 
381
  #: inc/vendor/cmb2/includes/CMB2.php:122
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Video Background\n"
6
+ "POT-Creation-Date: 2018-05-07 21:30-0700\n"
7
  "PO-Revision-Date: 2016-03-30 22:31-0700\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
27
  "\" target=\"_blank\">Check out Video Background Pro</a>"
28
  msgstr ""
29
 
30
+ #: candide-vidbg.php:149
31
  msgid "Show Advanced Options"
32
  msgstr ""
33
 
34
+ #: candide-vidbg.php:150
35
  msgid "Hide Advanced Options"
36
  msgstr ""
37
 
38
  #. Plugin Name of the plugin/theme
39
+ #: candide-vidbg.php:285 inc/classes/vidbg_siteorigin.php:53
40
+ #: inc/classes/vidbg_wpbakery.php:61 inc/classes/vidbg_wpbakery.php:73
41
+ #: inc/classes/vidbg_wpbakery.php:81 inc/classes/vidbg_wpbakery.php:89
42
+ #: inc/classes/vidbg_wpbakery.php:103 inc/classes/vidbg_wpbakery.php:116
43
+ #: inc/classes/vidbg_wpbakery.php:124 inc/classes/vidbg_wpbakery.php:137
44
  msgid "Video Background"
45
  msgstr ""
46
 
47
+ #: candide-vidbg.php:292
48
  msgid "Container"
49
  msgstr ""
50
 
51
+ #: candide-vidbg.php:293
52
  msgid ""
53
+ "Please specify the container you would like your video background to be in. "
54
+ "<a href=\"https://pushlabs.co/docs/video-background/#finding-your-container"
55
+ "\" target=\"_blank\">Learn how to find your container.</a>"
56
  msgstr ""
57
 
58
+ #: candide-vidbg.php:299 inc/classes/vidbg_siteorigin.php:67
59
+ #: inc/classes/vidbg_wpbakery.php:54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  msgid "Link to .mp4"
61
  msgstr ""
62
 
63
+ #: candide-vidbg.php:300
64
  msgid ""
65
  "Please specify the link to the .mp4 file. You can either enter a URL or "
66
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
67
  "file for video backgrounds."
68
  msgstr ""
69
 
70
+ #: candide-vidbg.php:304
71
  msgid "Upload .mp4 file"
72
  msgstr ""
73
 
74
+ #: candide-vidbg.php:309 inc/classes/vidbg_siteorigin.php:76
75
+ #: inc/classes/vidbg_wpbakery.php:66
76
  msgid "Link to .webm"
77
  msgstr ""
78
 
79
+ #: candide-vidbg.php:310
80
  msgid ""
81
  "Please specify the link to the .webm file. You can either enter a URL or "
82
  "upload a file.<br>For browser compatability, please enter an .mp4 and .webm "
83
  "file for video backgrounds."
84
  msgstr ""
85
 
86
+ #: candide-vidbg.php:314
87
  msgid "Upload .webm file"
88
  msgstr ""
89
 
90
+ #: candide-vidbg.php:319
91
  msgid "Link to fallback image"
92
  msgstr ""
93
 
94
+ #: candide-vidbg.php:320
95
  msgid ""
96
  "Please specify a link to the fallback image in case the browser does not "
97
  "support video backgrounds. You can either enter a URL or upload a file."
98
  msgstr ""
99
 
100
+ #: candide-vidbg.php:324
101
  msgid "Upload fallback image"
102
  msgstr ""
103
 
104
+ #: candide-vidbg.php:329
105
  msgid "Overlay"
106
  msgstr ""
107
 
108
+ #: candide-vidbg.php:330 inc/classes/vidbg_siteorigin.php:93
109
+ #: inc/classes/vidbg_wpbakery.php:88
110
  msgid ""
111
  "Add an overlay over the video. This is useful if your text isn't readable "
112
  "with a video background."
113
  msgstr ""
114
 
115
+ #: candide-vidbg.php:335 candide-vidbg.php:366 candide-vidbg.php:378
116
  msgid "Off"
117
  msgstr ""
118
 
119
+ #: candide-vidbg.php:336 candide-vidbg.php:367 candide-vidbg.php:379
120
  msgid "On"
121
  msgstr ""
122
 
123
+ #: candide-vidbg.php:342 inc/classes/vidbg_siteorigin.php:100
124
+ #: inc/classes/vidbg_wpbakery.php:95
125
  msgid "Overlay Color"
126
  msgstr ""
127
 
128
+ #: candide-vidbg.php:343 inc/classes/vidbg_siteorigin.php:101
129
+ #: inc/classes/vidbg_wpbakery.php:98
130
  msgid ""
131
  "If overlay is enabled, a color will be used for the overlay. You can specify "
132
  "the color here."
133
  msgstr ""
134
 
135
+ #: candide-vidbg.php:350 inc/classes/vidbg_siteorigin.php:109
136
+ #: inc/classes/vidbg_wpbakery.php:108
137
  msgid "Overlay Opacity"
138
  msgstr ""
139
 
140
+ #: candide-vidbg.php:351
141
  msgid ""
142
  "Specify the opacity of the overlay with the left being mostly transparent "
143
  "and the right being hardly transparent."
144
  msgstr ""
145
 
146
+ #: candide-vidbg.php:360
 
 
 
 
 
 
 
 
 
 
 
147
  msgid "Turn off loop?"
148
  msgstr ""
149
 
150
+ #: candide-vidbg.php:361 inc/classes/vidbg_siteorigin.php:119
151
+ #: inc/classes/vidbg_wpbakery.php:123
152
  msgid ""
153
  "Turn off the loop for Video Background. Once the video is complete, it will "
154
  "display the last frame of the video."
155
  msgstr ""
156
 
157
+ #: candide-vidbg.php:372 inc/classes/vidbg_siteorigin.php:128
158
+ #: inc/classes/vidbg_wpbakery.php:134
159
+ msgid "Display \"Tap to unmute\" button?"
 
 
 
 
 
 
 
 
 
 
160
  msgstr ""
161
 
162
+ #: candide-vidbg.php:373
163
  msgid ""
164
+ "Allow your users to interact with the sound of the video background. <a href="
165
+ "\"https://pushlabs.co/docs/video-background/#tap-to-unmute-text\" target="
166
+ "\"_blank\">Learn how to change this text.</a>"
167
  msgstr ""
168
 
169
+ #: candide-vidbg.php:385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  msgid ""
171
  "<a href=\"#vidbg_advanced_options\" class=\"button vidbg-button advanced-"
172
  "options-button\">Show Advanced options</a>"
173
  msgstr ""
174
 
175
+ #: candide-vidbg.php:482
176
+ msgid "Tap to Unmute"
 
 
 
 
 
 
177
  msgstr ""
178
 
179
+ #: candide-vidbg.php:540
180
  msgid "<h2>Video Background</h2>"
181
  msgstr ""
182
 
183
+ #: candide-vidbg.php:541
184
  msgid ""
185
  "<p>Video background makes it easy to add responsive, great looking video "
186
  "backgrounds to any element on your website.</p>"
187
  msgstr ""
188
 
189
+ #: candide-vidbg.php:542
190
  msgid "<h3>Getting Started</h3>"
191
  msgstr ""
192
 
193
+ #: candide-vidbg.php:543
194
+ msgid "<p>There are four ways to use Video Background"
 
 
195
  msgstr ""
196
 
197
+ #: candide-vidbg.php:545
198
+ msgid "<li>With the metabox</li>"
 
 
199
  msgstr ""
200
 
201
+ #: candide-vidbg.php:546
202
+ msgid "<li>With the WPBakery (Visual Composer) integration</li>"
 
 
 
203
  msgstr ""
204
 
205
+ #: candide-vidbg.php:547
206
+ msgid "<li>With the SiteOrigin Page Builder integration</li>"
207
  msgstr ""
208
 
209
+ #: candide-vidbg.php:548
210
+ msgid "<li>With the shortcode</li>"
 
 
 
211
  msgstr ""
212
 
213
+ #: candide-vidbg.php:550
214
  msgid ""
215
  "<a href=\"https://pushlabs.co/docs/video-background/\" class=\"button\" "
216
  "target=\"_blank\">Further Documentation</a>"
217
  msgstr ""
218
 
219
+ #: candide-vidbg.php:551
220
  msgid "<h3>Questions?</h3>"
221
  msgstr ""
222
 
223
+ #: candide-vidbg.php:552
224
  msgid ""
225
  "<p>If you have any feedback/questions regarding the plugin you can reach me "
226
  "<a href=\"https://wordpress.org/support/plugin/video-background\" target="
227
  "\"_blank\">here.</a>"
228
  msgstr ""
229
 
230
+ #: candide-vidbg.php:553
231
  msgid "<h3>Supporting the Plugin</h3>"
232
  msgstr ""
233
 
234
+ #: candide-vidbg.php:554
235
  msgid ""
236
  "<p>If you like Video Background and want to show your support, consider "
237
+ "purchasing <a href=\"http://pushlabs.co/video-background-pro\" target="
238
+ "\"_blank\">Video Background Pro</a>. It comes with plenty of helpful "
239
+ "features that make your life easier like:</p>"
240
  msgstr ""
241
 
242
+ #: candide-vidbg.php:556
243
  msgid "<li>Mobile video background playback on supported browsers</li>"
244
  msgstr ""
245
 
246
+ #: candide-vidbg.php:557
247
  msgid "<li>YouTube Integration</li>"
248
  msgstr ""
249
 
250
+ #: candide-vidbg.php:558
 
 
 
 
 
 
 
 
251
  msgid "<li>Frontend Play/Pause Button Option</li>"
252
  msgstr ""
253
 
254
+ #: candide-vidbg.php:559
255
  msgid "<li>Frontend Volume Button Option</li>"
256
  msgstr ""
257
 
258
+ #: candide-vidbg.php:560
259
  msgid "<li>Overlay Image Textures</li>"
260
  msgstr ""
261
 
262
+ #: candide-vidbg.php:561
263
  msgid "<li>Extensive Documentation</li>"
264
  msgstr ""
265
 
266
+ #: candide-vidbg.php:562
267
  msgid "<li>Video Tutorials</li>"
268
  msgstr ""
269
 
270
+ #: candide-vidbg.php:563
271
  msgid "<li>And Much More!</li>"
272
  msgstr ""
273
 
274
+ #: candide-vidbg.php:565
275
  msgid ""
276
  "<a href=\"http://pushlabs.co/video-background-pro\" class=\"button button-"
277
  "primary\" rel=\"nofollow\" target=\"_blank\">Learn More About Video "
278
  "Background Pro</a>"
279
  msgstr ""
280
 
281
+ #: candide-vidbg.php:577
282
+ msgid "<a href=\"options-general.php?page=pushlabs-vidbg\">Getting Started</a>"
283
+ msgstr ""
284
+
285
+ #: inc/classes/vidbg_siteorigin.php:69 inc/classes/vidbg_wpbakery.php:56
286
+ msgid "Please specify the link to the .mp4 file."
287
+ msgstr ""
288
+
289
+ #: inc/classes/vidbg_siteorigin.php:77 inc/classes/vidbg_wpbakery.php:68
290
+ msgid "Please specify the link to the .webm file."
291
+ msgstr ""
292
+
293
+ #: inc/classes/vidbg_siteorigin.php:84 inc/classes/vidbg_wpbakery.php:78
294
+ msgid "Fallback Image"
295
+ msgstr ""
296
+
297
+ #: inc/classes/vidbg_siteorigin.php:85 inc/classes/vidbg_wpbakery.php:80
298
+ msgid "Please upload a fallback image."
299
+ msgstr ""
300
+
301
+ #: inc/classes/vidbg_siteorigin.php:92 inc/classes/vidbg_wpbakery.php:86
302
+ msgid "Enable Overlay?"
303
+ msgstr ""
304
+
305
+ #: inc/classes/vidbg_siteorigin.php:110 inc/classes/vidbg_wpbakery.php:111
306
+ msgid ""
307
+ "Specify the opacity of the overlay. Accepts any value between 0.00-1.00 with "
308
+ "0 being completely transparent and 1 being completely invisible. Ex. 0.30"
309
+ msgstr ""
310
+
311
+ #: inc/classes/vidbg_siteorigin.php:118 inc/classes/vidbg_wpbakery.php:121
312
+ msgid "Disable Loop?"
313
+ msgstr ""
314
+
315
+ #: inc/classes/vidbg_siteorigin.php:129 inc/classes/vidbg_wpbakery.php:136
316
+ msgid "Allow your users to interact with the sound of the video background."
317
  msgstr ""
318
 
319
  #: inc/vendor/cmb2/includes/CMB2.php:122
readme.txt CHANGED
@@ -1,41 +1,37 @@
1
  === Plugin Name ===
2
  Contributors: blakedotvegas, pushlabs
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: 4.2
5
- Tested up to: 4.8.2
6
- Stable tag: 2.6.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- jQuery WordPress plugin to easily assign a video background to any element. Awesome.
11
 
12
  == Description ==
13
 
14
- This plugin is an easy and simple way to add a video background to any element on your website.
15
-
16
- Note: You may need to play around with the element’s z-index for the video background to display properly.
17
-
18
- There is now a pro version of Video Background with awesome features like YouTube and Visual Composer integration to make your life easier! [Check it out!](http://pushlabs.co/video-background-pro/ "Video Background Pro")
19
 
20
  There are 4 simple required fields:
21
 
22
- * Container: This fields specifies where you would like the video background. If you want it to cover the whole website, you would enter "body". If you want the video background to be in a class called ".header" you would enter ".header"
23
  * MP4: Link to the .mp4 file. For Safari and IE support.
24
  * WEBM: Link to the .webm file. For Chrome, Firefox, and Opera support.
25
  * Poster: This will be used for the fallback image if video background is not supported (mobile for example)
26
 
27
-
28
  There are also 5 additional optional fields for having a more beautiful video background:
29
 
30
- * Overlay: Adds a pattern overlay over the video for optimal reading of text.
31
  * Overlay Color: If overlay is enabled, you can select the color of the overlay using the colorpicker.
32
  * Overlay Alpha: If overlay is enabled, you can specify the amount of transparency.
33
- * Loop: Enable or disable the looping of your video! Play your video once, or infinite!
34
- * Mute: in Video Background, you now have the option to unmute your audio!
35
-
36
- There is now a more detailed shortcode for video background. Input this shortcode in the bottom of the content editor of the page or post you would like video background on.
37
- `[vidbg container="body" mp4="#" webm="#" poster="#" muted="true" loop="true" overlay="false" overlay_color="#000" overlay_alpha="0.3"]`
38
 
 
 
 
 
39
 
40
  Demo:
41
  <https://pushlabs.co/docs/video-background/>
@@ -52,7 +48,7 @@ Installation is simple.
52
 
53
  = What size is recommended for the videos? =
54
 
55
- 15mb is usually best for me, I try to not exceed that. Any video after 15mb starts to slow down and sometimes will not load. A great compression tool for Video Background is <https://clipchamp.com>. Check with your hosting provider to make sure you have enough bandwidth for video backgrounds.
56
 
57
  = Is this compatible with Internet Explorer? =
58
 
@@ -62,28 +58,42 @@ Video background works for Internet Explorer 9 and above. Any version below that
62
 
63
  Simply fill out the 4 easy fields. Be sure for the container you enter "body" (without the quotes)
64
 
 
 
 
 
65
  = What filetypes are allowed for fallback images? =
66
 
67
  Fallback images can be .jpg, .png, and .gif.
68
 
69
  = I entered all the correct fields, but my video will still not load. What am I doing wrong? =
70
 
71
- This can be an issue with the file size of the video you are uploading. Make sure that you video is compressed and is does not exceed 15mb. Once you get over 15mb, it takes a while to load. Check with your hosting provider to make sure you have enough bandwidth for video backgrounds.
72
 
73
  = I want to add a video background to a class called "header", how would I do that? =
74
 
75
  To add a video background to a class called **header** add ".header" to the container field. (without the quotes)
76
 
77
- = The Video Background Pro fields are annoying, can I get rid of them? =
78
-
79
- You sure can! Simply go to the "Settings > Video Background" menu tab and check the "Hide Muted Pro Fields" checkbox.
80
-
81
  == Screenshots ==
82
 
83
  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.
84
 
 
 
 
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
 
 
87
  = 2.6.3 =
88
  * Fixed: ability to display just fallback image.
89
  * Fixed: if fallback image is present, but video files are not. The video will not load to save on browser page size.
1
  === Plugin Name ===
2
  Contributors: blakedotvegas, pushlabs
3
+ Tags: video background, Visual Composer, WPBakery, SiteOrigin, page builder
4
+ Requires at least: 4.5
5
+ Tested up to: 4.9.5
6
+ Stable tag: 2.7.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Easily assign a video background to any element on your WordPress pages or posts. Now compatible with WPBakery (Visual Composer) and SiteOrigin Page Builder!
11
 
12
  == Description ==
13
 
14
+ Video Background offers a simple and easy way to add a video background to any element on your WordPress site.
 
 
 
 
15
 
16
  There are 4 simple required fields:
17
 
18
+ * Container: This fields specifies where you would like the video background.
19
  * MP4: Link to the .mp4 file. For Safari and IE support.
20
  * WEBM: Link to the .webm file. For Chrome, Firefox, and Opera support.
21
  * Poster: This will be used for the fallback image if video background is not supported (mobile for example)
22
 
 
23
  There are also 5 additional optional fields for having a more beautiful video background:
24
 
25
+ * Overlay: Add a color overlay over the video for optimal reading of text.
26
  * Overlay Color: If overlay is enabled, you can select the color of the overlay using the colorpicker.
27
  * Overlay Alpha: If overlay is enabled, you can specify the amount of transparency.
28
+ * Loop: Enable or disable the looping of the video background
29
+ * Tap to unmute: Add a "Tap to unmute" button to your video backgrounds to have your users engage with the sound. Compatible with Chrome's newest autoplay policies!
 
 
 
30
 
31
+ In addition to the Video Background metabox, WPBakery integration, and SiteOrigin Page Builder integration, you can use the shortcode for use anywhere on your Wordpress site:
32
+ ```
33
+ [vidbg container="body" mp4="#" webm="#" poster="#" muted="true" loop="true" overlay="false" overlay_color="#000" overlay_alpha="0.3"]
34
+ ```
35
 
36
  Demo:
37
  <https://pushlabs.co/docs/video-background/>
48
 
49
  = What size is recommended for the videos? =
50
 
51
+ 15mb is usually best, I try to not exceed that. Any video after 15mb starts to slow down and sometimes will not load. Check with your hosting provider to make sure you have enough bandwidth for video backgrounds.
52
 
53
  = Is this compatible with Internet Explorer? =
54
 
58
 
59
  Simply fill out the 4 easy fields. Be sure for the container you enter "body" (without the quotes)
60
 
61
+ = What is the best way to add a full width video background to my website? =
62
+
63
+ The best way to achieve this is to use a page builder like SiteOrigin or WPBakery (Visual Composer) to add a full width row, and apply the video background to it through the integration.
64
+
65
  = What filetypes are allowed for fallback images? =
66
 
67
  Fallback images can be .jpg, .png, and .gif.
68
 
69
  = I entered all the correct fields, but my video will still not load. What am I doing wrong? =
70
 
71
+ This can be an issue with the file size of the video you are uploading. Make sure that you video is compressed and is does not exceed 15mb.
72
 
73
  = I want to add a video background to a class called "header", how would I do that? =
74
 
75
  To add a video background to a class called **header** add ".header" to the container field. (without the quotes)
76
 
 
 
 
 
77
  == Screenshots ==
78
 
79
  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.
80
 
81
+ 2. Use WPBakery (Visual Composer)? Video Background & WPBakery allow you to easily add a video background to your row.
82
+
83
+ 3. Use SiteOrigin Page Builder? Video Background & SiteOrigin allow you to easily add a video background to your row.
84
+
85
  == Changelog ==
86
 
87
+ = 2.7.0 =
88
+ * Added: You can now add a video background to your WPBakery (Visual Composer) row!
89
+ * Added: You can now add a video background to your SiteOrigin Page Builder row!
90
+ * Added: vidbg_update_message() to let users know of crucial updates
91
+ * Removed: vidbg_is_wp_version()
92
+ * Removed: Pesky Video Background Pro fields
93
+ * Updated: Settings page slug
94
+ * Fixed: Simplified the plugin's resize methods.
95
+ * Added: As a result of recent browser autoplay policy changes, the default audio on option has been removed. Now, you can add a nice "Tap to unmute" button to the video background!
96
+
97
  = 2.6.3 =
98
  * Fixed: ability to display just fallback image.
99
  * Fixed: if fallback image is present, but video files are not. The video will not load to save on browser page size.