All-in-One Video Gallery - Version 1.6.0

Version Description

  • Fix: Security fix.
  • Fix: [+] few minor bug fixes.
Download this release

Release Info

Developer plugins360
Plugin Icon 128x128 All-in-One Video Gallery
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.9 to 1.6.0

README.txt CHANGED
@@ -4,9 +4,9 @@ Contributors: plugins360, freemius
4
  Donate link: https://plugins360.com
5
  Tags: player, youtube, vimeo, live, stream
6
  Requires at least: 4.4.0
7
- Tested up to: 5.0
8
  Requires PHP: 5.3.0
9
- Stable tag: 1.5.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -91,6 +91,11 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
94
  = 1.5.9 =
95
 
96
  * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some WordPress Environments.
@@ -168,6 +173,11 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
168
 
169
  == Upgrade Notice ==
170
 
 
 
 
 
 
171
  = 1.5.9 =
172
 
173
  * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some WordPress Environments.
4
  Donate link: https://plugins360.com
5
  Tags: player, youtube, vimeo, live, stream
6
  Requires at least: 4.4.0
7
+ Tested up to: 5.1
8
  Requires PHP: 5.3.0
9
+ Stable tag: 1.6.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
91
 
92
  == Changelog ==
93
 
94
+ = 1.6.0 =
95
+
96
+ * Fix: Security fix.
97
+ * Fix: [+] few minor bug fixes.
98
+
99
  = 1.5.9 =
100
 
101
  * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some WordPress Environments.
173
 
174
  == Upgrade Notice ==
175
 
176
+ = 1.6.0 =
177
+
178
+ * Fix: Security fix.
179
+ * Fix: [+] few minor bug fixes.
180
+
181
  = 1.5.9 =
182
 
183
  * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some WordPress Environments.
admin/assets/css/admin.css CHANGED
@@ -78,7 +78,8 @@
78
  *
79
  *--------------------------------------------------------------------------------------------*/
80
  #aiovg-welcome .aiovg-badge {
81
- background: #0073aa url('../images/logo.png') no-repeat center;
 
82
  }
83
 
84
  /*----------------------------------------------------------------------------------------------
78
  *
79
  *--------------------------------------------------------------------------------------------*/
80
  #aiovg-welcome .aiovg-badge {
81
+ margin-bottom: 0;
82
+ background: #0073aa url( '../images/logo.png' ) no-repeat top;
83
  }
84
 
85
  /*----------------------------------------------------------------------------------------------
admin/categories.php CHANGED
@@ -56,7 +56,7 @@ class AIOVG_Admin_Categories {
56
  'public' => true,
57
  'show_ui' => true,
58
  'show_admin_column' => true,
59
- 'show_in_nav_menus' => true,
60
  'show_in_rest' => true,
61
  'show_tagcloud' => false,
62
  'capabilities' => array(
56
  'public' => true,
57
  'show_ui' => true,
58
  'show_admin_column' => true,
59
+ 'show_in_nav_menus' => false,
60
  'show_in_rest' => true,
61
  'show_tagcloud' => false,
62
  'capabilities' => array(
admin/partials/welcome.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
-
3
  /**
4
  * Welcome page.
5
  *
@@ -7,142 +7,158 @@
7
  * @since 1.0.0
8
  *
9
  * @package All_In_One_Video_Gallery
10
- */
11
- ?>
12
 
13
  <div id="aiovg-welcome" class="wrap about-wrap full-width-layout aiovg-welcome">
14
 
15
- <h1><?php printf( __( 'Welcome to "All-in-One Video Gallery - %s"', 'all-in-one-video-gallery' ), AIOVG_PLUGIN_VERSION ); ?></h1>
 
 
16
 
17
  <p class="about-text">
18
- <?php _e( 'No coding required. A Responsive & Lightweight video gallery plugin.', 'all-in-one-video-gallery' ); ?>
 
 
19
  </p>
20
 
21
- <p class="about-text">
22
- <?php _e( 'HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.', 'all-in-one-video-gallery' ); ?>
23
- </p>
24
 
25
- <div class="wp-badge aiovg-badge"></div>
 
 
26
 
27
  <h2 class="nav-tab-wrapper wp-clearfix">
28
- <?php
29
- foreach ( $tabs as $tab => $title ) {
30
- $class = ( $tab == $active_tab ) ? 'nav-tab nav-tab-active' : 'nav-tab';
31
- printf( '<a href="%s" class="%s">%s</a>', esc_url( admin_url( add_query_arg( 'page', $tab, 'index.php' ) ) ), $class, $title );
32
- }
33
- ?>
 
 
 
 
 
34
  </h2>
35
 
36
- <?php if ( 'aiovg_welcome' == $active_tab ) : ?>
 
 
 
37
  <p class="about-description">
38
- <?php _e( "Supports any browser & video formats such as MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Dailymotion, Facebook, etc.", 'all-in-one-video-gallery' ); ?>
 
 
 
 
 
 
39
  </p>
40
-
41
- <div class="changelog">
42
- <div class="two-col">
43
- <div class="col">
44
- <!-- 1. Configure Settings -->
45
- <h3>
46
- <span>1.</span>
47
- <a href="<?php echo admin_url( 'edit.php?post_type=aiovg_videos&page=aiovg_settings' ); ?>">
48
- <?php _e( 'Configure Settings', 'all-in-one-video-gallery' ); ?>
49
- </a>
50
- </h3>
51
-
52
- <p>
53
- <?php _e( '100+ Settings. Configure player options like "Autoplay", "Loop", "Preload" and gallery options like "Number of Columns", "Pagination", "Comments", etc.', 'all-in-one-video-gallery' ); ?>
54
- </p>
55
-
56
- <br />
57
-
58
- <!-- 2. Categories => Add -->
59
- <h3>
60
- <span>2.</span>
61
- <a href="<?php echo admin_url( 'edit-tags.php?taxonomy=aiovg_categories&post_type=aiovg_videos' ); ?>">
62
- <?php _e( 'Categories &rarr; Add', 'all-in-one-video-gallery' ); ?>
63
- </a>
64
- </h3>
65
-
66
- <p>
67
- <?php _e( "Create unlimited categories and subcategory levels. Categories allow you to organize your videos in a way that makes it easy for your users to find exactly what they're looking for.", 'all-in-one-video-gallery' ); ?>
68
- </p>
69
 
70
- <br />
71
-
72
- <!-- 3. Video Gallery => Add New -->
73
- <h3>
74
- <span>3.</span>
75
- <a href="<?php echo admin_url( 'post-new.php?post_type=aiovg_videos' ); ?>">
76
- <?php _e( 'Video Gallery &rarr; Add New', 'all-in-one-video-gallery' ); ?>
77
- </a>
78
- </h3>
79
-
80
- <p>
81
- <?php _e( 'Add unlimited videos. "All-in-One Video Gallery" videos are CUSTOM POST TYPE called "aiovg_videos". So, each video is a POST. This makes the gallery more powerful and the possibility of extending the plugin is huge.', 'all-in-one-video-gallery' ); ?>
82
- </p>
83
- </div>
84
-
85
- <div class="col">
86
- <!-- 4. Front-End Gallery Display -->
87
- <h3>
88
- <span>4.</span>
89
- <?php _e( 'Front-End Gallery Display', 'all-in-one-video-gallery' ); ?>
90
- </h3>
91
-
92
- <p>
93
- <?php _e( "100% Gutenberg compatible. Visually build your gallery using the plugin's Gutenberg Blocks. There is a Shortcode Builder for the old classic WP Editor.", 'all-in-one-video-gallery' ); ?>
94
- </p>
95
-
96
- <br />
97
-
98
- <!-- 5. Configure Sidebars -->
99
- <h3>
100
- <span>5.</span>
101
- <?php _e( 'Configure Sidebars', 'all-in-one-video-gallery' ); ?>
102
- </h3>
103
-
104
- <p>
105
- <?php _e( 'Decorate your website sidebars using our Widgets. There are separate Widgets available for categories display, video gallery, single video player, search form, etc.', 'all-in-one-video-gallery' ); ?>
106
- </p>
107
-
108
- <br />
109
-
110
- <!-- More Features -->
111
- <h3>
112
- <span>[+]</span>
113
- <?php _e( 'More Features', 'all-in-one-video-gallery' ); ?>
114
- </h3>
115
-
116
- <p>
117
- <?php _e( 'There is a PREMIUM version with even more powerful features like Custom Logo & Branding, HLS / M(PEG)-Dash support, Live Streaming, Popup Gallery, Videos Slider, VAST / VPAID Ads, etc.', 'all-in-one-video-gallery' ); ?>
118
- </p>
119
- </div>
120
- </div>
121
- </div>
122
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
123
 
124
- <?php if ( 'aiovg_support' == $active_tab ) : ?>
125
- <p class="about-description"><?php _e( 'Need Help?', 'all-in-one-video-gallery' ); ?></p>
 
 
 
 
 
126
 
127
  <div class="changelog">
128
  <div class="two-col">
129
  <div class="col">
130
- <h3><?php _e( 'Phenomenal Support', 'all-in-one-video-gallery' ); ?></h3>
 
 
131
 
132
  <p>
133
- <?php printf( __( 'We do our best to provide the best support we can. If you encounter a problem or have a question, simply submit your question using our <a href="%s" target="_blank">support form</a>.', 'all-in-one-video-gallery' ), 'https://wordpress.org/support/plugin/all-in-one-video-gallery' ); ?>
 
 
134
  </p>
135
  </div>
136
 
137
  <div class="col">
138
- <h3><?php _e( 'Need Even Faster Support?', 'all-in-one-video-gallery' ); ?></h3>
 
 
139
 
140
  <p>
141
- <?php printf( __( 'Our <a href="%s" target="_blank">Priority Support</a> system is there for customers that need faster and/or more in-depth assistance.', 'all-in-one-video-gallery' ), 'https://plugins360.com/support/' ); ?>
 
 
142
  </p>
143
  </div>
144
  </div>
145
  </div>
146
- <?php endif; ?>
 
 
 
147
 
148
  </div>
1
+ <?php
2
+
3
  /**
4
  * Welcome page.
5
  *
7
  * @since 1.0.0
8
  *
9
  * @package All_In_One_Video_Gallery
10
+ */
11
+ ?>
12
 
13
  <div id="aiovg-welcome" class="wrap about-wrap full-width-layout aiovg-welcome">
14
 
15
+ <h1><?php
16
+ printf( __( 'All-in-One Video Gallery - %s', 'all-in-one-video-gallery' ), AIOVG_PLUGIN_VERSION );
17
+ ?></h1>
18
 
19
  <p class="about-text">
20
+ <?php
21
+ _e( "The last video player & gallery plugin you'll ever need.", 'all-in-one-video-gallery' );
22
+ ?>
23
  </p>
24
 
25
+ <?php
26
+ ?>
 
27
 
28
+ <div class="wp-badge aiovg-badge"><?php
29
+ printf( __( 'Version %s', 'all-in-one-video-gallery' ), AIOVG_PLUGIN_VERSION );
30
+ ?></div>
31
 
32
  <h2 class="nav-tab-wrapper wp-clearfix">
33
+ <?php
34
+ foreach ( $tabs as $tab => $title ) {
35
+ $class = ( $tab == $active_tab ? 'nav-tab nav-tab-active' : 'nav-tab' );
36
+ printf(
37
+ '<a href="%s" class="%s">%s</a>',
38
+ esc_url( admin_url( add_query_arg( 'page', $tab, 'index.php' ) ) ),
39
+ $class,
40
+ $title
41
+ );
42
+ }
43
+ ?>
44
  </h2>
45
 
46
+ <?php
47
+
48
+ if ( 'aiovg_welcome' == $active_tab ) {
49
+ ?>
50
  <p class="about-description">
51
+ <strong><?php
52
+ printf( __( 'Step #%d:', 'all-in-one-video-gallery' ), 0 );
53
+ ?></strong>
54
+ &rarr;
55
+ <?php
56
+ _e( 'Install & Activate <strong>All-in-One Video Gallery</strong>', 'all-in-one-video-gallery' );
57
+ ?>
58
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
+ <p class="about-description">
61
+ <strong><?php
62
+ printf( __( 'Step #%d:', 'all-in-one-video-gallery' ), 1 );
63
+ ?></strong>
64
+ &rarr;
65
+ <code><?php
66
+ _e( 'Optional', 'all-in-one-video-gallery' );
67
+ ?></code>
68
+ <a href="<?php
69
+ echo esc_url( admin_url( 'edit-tags.php?taxonomy=aiovg_categories&post_type=aiovg_videos' ) ) ;
70
+ ?>">
71
+ <?php
72
+ _e( 'Add Categories', 'all-in-one-video-gallery' );
73
+ ?>
74
+ </a>
75
+ </p>
76
+
77
+ <p class="about-description">
78
+ <strong><?php
79
+ printf( __( 'Step #%d:', 'all-in-one-video-gallery' ), 2 );
80
+ ?></strong>
81
+ &rarr;
82
+ <a href="<?php
83
+ echo esc_url( admin_url( 'post-new.php?post_type=aiovg_videos' ) ) ;
84
+ ?>">
85
+ <?php
86
+ _e( 'Add Videos', 'all-in-one-video-gallery' );
87
+ ?>
88
+ </a>
89
+ </p>
90
+
91
+ <p class="about-description">
92
+ <strong><?php
93
+ printf( __( 'Step #%d:', 'all-in-one-video-gallery' ), 3 );
94
+ ?></strong>
95
+ &rarr;
96
+ <code><?php
97
+ _e( 'Optional', 'all-in-one-video-gallery' );
98
+ ?></code>
99
+ <?php
100
+ printf( __( 'Add a Categories <a href="%s">Page</a> to your site front-end. Find step by step instructions <a href="%s" target="_blank">here</a>', 'all-in-one-video-gallery' ), esc_url( admin_url( 'post-new.php?post_type=page' ) ), 'https://plugins360.com/all-in-one-video-gallery/displaying-categories/' );
101
+ ?>
102
+ </p>
103
+
104
+ <p class="about-description">
105
+ <strong><?php
106
+ printf( __( 'Step #%d:', 'all-in-one-video-gallery' ), 4 );
107
+ ?></strong>
108
+ &rarr;
109
+ <?php
110
+ printf( __( 'Add a Videos <a href="%s">Page</a> to your site front-end. Find step by step instructions <a href="%s" target="_blank">here</a>', 'all-in-one-video-gallery' ), esc_url( admin_url( 'post-new.php?post_type=page' ) ), 'https://plugins360.com/all-in-one-video-gallery/displaying-video-gallery/' );
111
+ ?>
112
+ </p>
113
+
114
+ <p>
115
+ <?php
116
+ printf( __( 'Please <a href="%s" target="_blank">refer</a> for more advanced tutorials.', 'all-in-one-video-gallery' ), 'https://plugins360.com/all-in-one-video-gallery/documentation/' );
117
+ ?>
118
+ </p>
119
+ <?php
120
+ }
121
+
122
+ ?>
123
 
124
+ <?php
125
+
126
+ if ( 'aiovg_support' == $active_tab ) {
127
+ ?>
128
+ <p class="about-description"><?php
129
+ _e( 'Need Help?', 'all-in-one-video-gallery' );
130
+ ?></p>
131
 
132
  <div class="changelog">
133
  <div class="two-col">
134
  <div class="col">
135
+ <h3><?php
136
+ _e( 'Phenomenal Support', 'all-in-one-video-gallery' );
137
+ ?></h3>
138
 
139
  <p>
140
+ <?php
141
+ printf( __( 'We do our best to provide the best support we can. If you encounter a problem or have a question, simply submit your question using our <a href="%s" target="_blank">support form</a>.', 'all-in-one-video-gallery' ), 'https://wordpress.org/support/plugin/all-in-one-video-gallery' );
142
+ ?>
143
  </p>
144
  </div>
145
 
146
  <div class="col">
147
+ <h3><?php
148
+ _e( 'Need Even Faster Support?', 'all-in-one-video-gallery' );
149
+ ?></h3>
150
 
151
  <p>
152
+ <?php
153
+ printf( __( 'Our <a href="%s" target="_blank">Priority Support</a> system is there for customers that need faster and/or more in-depth assistance.', 'all-in-one-video-gallery' ), 'https://plugins360.com/support/' );
154
+ ?>
155
  </p>
156
  </div>
157
  </div>
158
  </div>
159
+ <?php
160
+ }
161
+
162
+ ?>
163
 
164
  </div>
admin/videos.php CHANGED
@@ -78,7 +78,7 @@ class AIOVG_Admin_Videos {
78
  'menu_position' => 10,
79
  'menu_icon' => 'dashicons-playlist-video',
80
  'show_in_admin_bar' => true,
81
- 'show_in_nav_menus' => true,
82
  'show_in_rest' => false,
83
  'can_export' => true,
84
  'has_archive' => true,
78
  'menu_position' => 10,
79
  'menu_icon' => 'dashicons-playlist-video',
80
  'show_in_admin_bar' => true,
81
+ 'show_in_nav_menus' => false,
82
  'show_in_rest' => false,
83
  'can_export' => true,
84
  'has_archive' => true,
all-in-one-video-gallery.php CHANGED
@@ -11,7 +11,7 @@
11
  * Plugin Name: All-in-One Video Gallery
12
  * Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
  * Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
- * Version: 1.5.9
15
  * Author: Team Plugins360
16
  * Author URI: https://plugins360.com
17
  * License: GPL-2.0+
@@ -76,7 +76,7 @@ if ( !function_exists( 'aiovg_fs' ) ) {
76
 
77
  // The current version of the plugin
78
  if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
- define( 'AIOVG_PLUGIN_VERSION', '1.5.9' );
80
  }
81
  // The unique identifier of the plugin
82
  if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
11
  * Plugin Name: All-in-One Video Gallery
12
  * Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
  * Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
+ * Version: 1.6.0
15
  * Author: Team Plugins360
16
  * Author URI: https://plugins360.com
17
  * License: GPL-2.0+
76
 
77
  // The current version of the plugin
78
  if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
+ define( 'AIOVG_PLUGIN_VERSION', '1.6.0' );
80
  }
81
  // The unique identifier of the plugin
82
  if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
freemius/includes/class-freemius.php CHANGED
@@ -2977,6 +2977,10 @@
2977
  * @since 1.1.7.3
2978
  */
2979
  static function _toggle_debug_mode() {
 
 
 
 
2980
  $is_on = fs_request_get( 'is_on', false, 'post' );
2981
 
2982
  if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
@@ -3008,8 +3012,16 @@
3008
  * @since 1.2.1.7
3009
  */
3010
  static function _get_db_option() {
 
 
3011
  $option_name = fs_request_get( 'option_name' );
3012
 
 
 
 
 
 
 
3013
  $value = get_option( $option_name );
3014
 
3015
  $result = array(
@@ -3032,7 +3044,16 @@
3032
  * @since 1.2.1.7
3033
  */
3034
  static function _set_db_option() {
3035
- $option_name = fs_request_get( 'option_name' );
 
 
 
 
 
 
 
 
 
3036
  $option_value = fs_request_get( 'option_value' );
3037
 
3038
  if ( ! empty( $option_value ) ) {
2977
  * @since 1.1.7.3
2978
  */
2979
  static function _toggle_debug_mode() {
2980
+ if ( ! is_super_admin() ) {
2981
+ return;
2982
+ }
2983
+
2984
  $is_on = fs_request_get( 'is_on', false, 'post' );
2985
 
2986
  if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
3012
  * @since 1.2.1.7
3013
  */
3014
  static function _get_db_option() {
3015
+ check_admin_referer( 'fs_get_db_option' );
3016
+
3017
  $option_name = fs_request_get( 'option_name' );
3018
 
3019
+ if ( ! is_super_admin() ||
3020
+ ! fs_starts_with( $option_name, 'fs_' )
3021
+ ) {
3022
+ self::shoot_ajax_failure();
3023
+ }
3024
+
3025
  $value = get_option( $option_name );
3026
 
3027
  $result = array(
3044
  * @since 1.2.1.7
3045
  */
3046
  static function _set_db_option() {
3047
+ check_admin_referer( 'fs_set_db_option' );
3048
+
3049
+ $option_name = fs_request_get( 'option_name' );
3050
+
3051
+ if ( ! is_super_admin() ||
3052
+ ! fs_starts_with( $option_name, 'fs_' )
3053
+ ) {
3054
+ self::shoot_ajax_failure();
3055
+ }
3056
+
3057
  $option_value = fs_request_get( 'option_value' );
3058
 
3059
  if ( ! empty( $option_value ) ) {
freemius/start.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @var string
17
  */
18
- $this_sdk_version = '2.2.3';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
15
  *
16
  * @var string
17
  */
18
+ $this_sdk_version = '2.2.4';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
freemius/templates/debug.php CHANGED
@@ -113,6 +113,7 @@
113
  if (optionName) {
114
  $.post(ajaxurl, {
115
  action : 'fs_get_db_option',
 
116
  option_name: optionName
117
  }, function (response) {
118
  if (response.data.value)
@@ -132,6 +133,7 @@
132
  if (optionValue) {
133
  $.post(ajaxurl, {
134
  action : 'fs_set_db_option',
 
135
  option_name : optionName,
136
  option_value: optionValue
137
  }, function () {
113
  if (optionName) {
114
  $.post(ajaxurl, {
115
  action : 'fs_get_db_option',
116
+ _wpnonce : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
117
  option_name: optionName
118
  }, function (response) {
119
  if (response.data.value)
133
  if (optionValue) {
134
  $.post(ajaxurl, {
135
  action : 'fs_set_db_option',
136
+ _wpnonce : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
137
  option_name : optionName,
138
  option_value: optionValue
139
  }, function () {
freemius/templates/forms/deactivation/form.php CHANGED
@@ -1,497 +1,497 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.2
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- */
16
- $fs = freemius( $VARS['id'] );
17
- $slug = $fs->get_slug();
18
-
19
- $confirmation_message = $fs->apply_filters( 'uninstall_confirmation_message', '' );
20
-
21
- $reasons = $VARS['reasons'];
22
-
23
- $reasons_list_items_html = '';
24
-
25
- foreach ( $reasons as $reason ) {
26
- $list_item_classes = 'reason' . ( ! empty( $reason['input_type'] ) ? ' has-input' : '' );
27
-
28
- if ( isset( $reason['internal_message'] ) && ! empty( $reason['internal_message'] ) ) {
29
- $list_item_classes .= ' has-internal-message';
30
- $reason_internal_message = $reason['internal_message'];
31
- } else {
32
- $reason_internal_message = '';
33
- }
34
-
35
- $reason_input_type = ( ! empty( $reason['input_type'] ) ? $reason['input_type'] : '' );
36
- $reason_input_placeholder = ( ! empty( $reason['input_placeholder'] ) ? $reason['input_placeholder'] : '' );
37
-
38
- $reason_list_item_html = <<< HTML
39
- <li class="{$list_item_classes}"
40
- data-input-type="{$reason_input_type}"
41
- data-input-placeholder="{$reason_input_placeholder}">
42
- <label>
43
- <span>
44
- <input type="radio" name="selected-reason" value="{$reason['id']}"/>
45
- </span>
46
- <span>{$reason['text']}</span>
47
- </label>
48
- <div class="internal-message">{$reason_internal_message}</div>
49
- </li>
50
- HTML;
51
-
52
- $reasons_list_items_html .= $reason_list_item_html;
53
- }
54
-
55
- $is_anonymous = ( ! $fs->is_registered() );
56
- if ( $is_anonymous ) {
57
- $anonymous_feedback_checkbox_html = sprintf(
58
- '<label class="anonymous-feedback-label"><input type="checkbox" class="anonymous-feedback-checkbox"> %s</label>',
59
- fs_esc_html_inline( 'Anonymous feedback', 'anonymous-feedback', $slug )
60
- );
61
- } else {
62
- $anonymous_feedback_checkbox_html = '';
63
- }
64
-
65
- // Aliases.
66
- $deactivate_text = fs_text_inline( 'Deactivate', 'deactivate', $slug );
67
- $theme_text = fs_text_inline( 'Theme', 'theme', $slug );
68
- $activate_x_text = fs_text_inline( 'Activate %s', 'activate-x', $slug );
69
-
70
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
71
- ?>
72
- <?php $fs->_maybe_add_subscription_cancellation_dialog_box() ?>
73
- <script type="text/javascript">
74
- (function ($) {
75
- var reasonsHtml = <?php echo json_encode( $reasons_list_items_html ) ?>,
76
- modalHtml =
77
- '<div class="fs-modal fs-modal-deactivation-feedback<?php echo empty( $confirmation_message ) ? ' no-confirmation-message' : ''; ?>">'
78
- + ' <div class="fs-modal-dialog">'
79
- + ' <div class="fs-modal-header">'
80
- + ' <h4><?php fs_esc_attr_echo_inline( 'Quick Feedback', 'quick-feedback' , $slug ) ?></h4>'
81
- + ' </div>'
82
- + ' <div class="fs-modal-body">'
83
- + ' <div class="fs-modal-panel" data-panel-id="confirm"><p><?php echo $confirmation_message; ?></p></div>'
84
- + ' <div class="fs-modal-panel active" data-panel-id="reasons"><h3><strong><?php echo esc_js( sprintf( fs_text_inline( 'If you have a moment, please let us know why you are %s', 'deactivation-share-reason' , $slug ), ( $fs->is_plugin() ? fs_text_inline( 'deactivating', 'deactivating', $slug ) : fs_text_inline( 'switching', 'switching', $slug ) ) ) ) ?>:</strong></h3><ul id="reasons-list">' + reasonsHtml + '</ul></div>'
85
- + ' </div>'
86
- + ' <div class="fs-modal-footer">'
87
- + ' <?php echo $anonymous_feedback_checkbox_html ?>'
88
- + ' <a href="#" class="button button-secondary button-deactivate"></a>'
89
- + ' <a href="#" class="button button-primary button-close"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>'
90
- + ' </div>'
91
- + ' </div>'
92
- + '</div>',
93
- $modal = $(modalHtml),
94
- $deactivateLink = $('#the-list .deactivate > [data-module-id=<?php echo $fs->get_id() ?>].fs-module-id').prev(),
95
- selectedReasonID = false,
96
- redirectLink = '',
97
- $anonymousFeedback = $modal.find( '.anonymous-feedback-label' ),
98
- isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
99
- otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
100
- dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
101
- deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>,
102
- $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' );
103
-
104
- $modal.appendTo($('body'));
105
-
106
- if ( 0 !== $subscriptionCancellationModal.length ) {
107
- $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
108
- if ( false === cancelSubscription ) {
109
- showModal();
110
-
111
- $subscriptionCancellationModal.trigger( 'closeModal' );
112
- } else {
113
- var $errorMessage = $subscriptionCancellationModal.find( '.notice-error' );
114
-
115
- <?php
116
- $subscription_cancellation_context = $fs->is_paid_trial() ?
117
- fs_text_inline( 'trial', 'trial', $slug ) :
118
- fs_text_inline( 'subscription', 'subscription', $slug );
119
- ?>
120
-
121
- $.ajax({
122
- url : ajaxurl,
123
- method : 'POST',
124
- data : {
125
- action : '<?php echo $fs->get_ajax_action( 'cancel_subscription_or_trial' ) ?>',
126
- security : '<?php echo $fs->get_ajax_security( 'cancel_subscription_or_trial' ) ?>',
127
- module_id: '<?php echo $fs->get_id() ?>'
128
- },
129
- beforeSend: function() {
130
- $errorMessage.hide();
131
-
132
- $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
133
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js(
134
- sprintf( fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ), $subscription_cancellation_context )
135
- ) ?>' );
136
- },
137
- success: function( result ) {
138
- if ( result.success ) {
139
- $subscriptionCancellationModal.removeClass( 'has-subscription-actions' );
140
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).removeClass( 'warn' );
141
-
142
- $subscriptionCancellationModal.remove();
143
- showModal();
144
- } else {
145
- $errorMessage.find( '> p' ).html( result.error );
146
- $errorMessage.show();
147
-
148
- $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).removeClass( 'disabled' );
149
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).html( <?php echo json_encode( sprintf(
150
- fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
151
- ucfirst( $subscription_cancellation_context )
152
- ) ) ?> );
153
- }
154
- }
155
- });
156
- }
157
- });
158
- }
159
-
160
- registerEventHandlers();
161
-
162
- function registerEventHandlers() {
163
- $deactivateLink.click(function (evt) {
164
- evt.preventDefault();
165
-
166
- redirectLink = $(this).attr('href');
167
-
168
- if ( 0 == $subscriptionCancellationModal.length ) {
169
- showModal();
170
- } else {
171
- $subscriptionCancellationModal.trigger( 'showModal' );
172
- }
173
- });
174
-
175
- <?php
176
- if ( ! $fs->is_plugin() ) {
177
- /**
178
- * For "theme" module type, the modal is shown when the current user clicks on
179
- * the "Activate" button of any other theme. The "Activate" button is actually
180
- * a link to the "Themes" page (/wp-admin/themes.php) containing query params
181
- * that tell WordPress to deactivate the current theme and activate a different theme.
182
- *
183
- * @author Leo Fajardo (@leorw)
184
- * @since 1.2.2
185
- *
186
- * @since 1.2.2.7 Don't trigger the deactivation feedback form if activating the premium version of the theme.
187
- */
188
- ?>
189
- $('body').on('click', '.theme-browser .theme:not([data-slug=<?php echo $fs->get_premium_slug() ?>]) .theme-actions .button.activate', function (evt) {
190
- evt.preventDefault();
191
-
192
- redirectLink = $(this).attr('href');
193
-
194
- showModal();
195
- });
196
- <?php
197
- } ?>
198
-
199
- $modal.on('input propertychange', '.reason-input input', function () {
200
- if (!isOtherReasonSelected()) {
201
- return;
202
- }
203
-
204
- var reason = $(this).val().trim();
205
-
206
- /**
207
- * If reason is not empty, remove the error-message class of the message container
208
- * to change the message color back to default.
209
- */
210
- if (reason.length > 0) {
211
- $('.message').removeClass('error-message');
212
- enableDeactivateButton();
213
- }
214
- });
215
-
216
- $modal.on('blur', '.reason-input input', function () {
217
- var $userReason = $(this);
218
-
219
- setTimeout(function () {
220
- if (!isOtherReasonSelected()) {
221
- return;
222
- }
223
-
224
- /**
225
- * If reason is empty, add the error-message class to the message container
226
- * to change the message color to red.
227
- */
228
- if (0 === $userReason.val().trim().length) {
229
- $('.message').addClass('error-message');
230
- disableDeactivateButton();
231
- }
232
- }, 150);
233
- });
234
-
235
- $modal.on('click', '.fs-modal-footer .button', function (evt) {
236
- evt.preventDefault();
237
-
238
- if ($(this).hasClass('disabled')) {
239
- return;
240
- }
241
-
242
- var _parent = $(this).parents('.fs-modal:first');
243
- var _this = $(this);
244
-
245
- if (_this.hasClass('allow-deactivate')) {
246
- var $radio = $('input[type="radio"]:checked');
247
-
248
- if (0 === $radio.length) {
249
- if ( ! deleteThemeUpdateData ) {
250
- // If no selected reason, just deactivate the plugin.
251
- window.location.href = redirectLink;
252
- } else {
253
- $.ajax({
254
- url : ajaxurl,
255
- method : 'POST',
256
- data : {
257
- action : '<?php echo $fs->get_ajax_action( 'delete_theme_update_data' ) ?>',
258
- security : '<?php echo $fs->get_ajax_security( 'delete_theme_update_data' ) ?>',
259
- module_id: '<?php echo $fs->get_id() ?>'
260
- },
261
- beforeSend: function() {
262
- _parent.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
263
- _parent.find( '.fs-modal-footer .button-secondary' ).text( 'Processing...' );
264
- },
265
- complete : function() {
266
- window.location.href = redirectLink;
267
- }
268
- });
269
- }
270
-
271
- return;
272
- }
273
-
274
- var $selected_reason = $radio.parents('li:first'),
275
- $input = $selected_reason.find('textarea, input[type="text"]'),
276
- userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
277
-
278
- if (isOtherReasonSelected() && ( '' === userReason )) {
279
- return;
280
- }
281
-
282
- $.ajax({
283
- url : ajaxurl,
284
- method : 'POST',
285
- data : {
286
- action : '<?php echo $fs->get_ajax_action( 'submit_uninstall_reason' ) ?>',
287
- security : '<?php echo $fs->get_ajax_security( 'submit_uninstall_reason' ) ?>',
288
- module_id : '<?php echo $fs->get_id() ?>',
289
- reason_id : $radio.val(),
290
- reason_info : userReason,
291
- is_anonymous: isAnonymousFeedback()
292
- },
293
- beforeSend: function () {
294
- _parent.find('.fs-modal-footer .button').addClass('disabled');
295
- _parent.find('.fs-modal-footer .button-secondary').text('Processing...');
296
- },
297
- complete : function () {
298
- // Do not show the dialog box, deactivate the plugin.
299
- window.location.href = redirectLink;
300
- }
301
- });
302
- } else if (_this.hasClass('button-deactivate')) {
303
- // Change the Deactivate button's text and show the reasons panel.
304
- _parent.find('.button-deactivate').addClass('allow-deactivate');
305
-
306
- showPanel('reasons');
307
- }
308
- });
309
-
310
- $modal.on('click', 'input[type="radio"]', function () {
311
- var $selectedReasonOption = $( this );
312
-
313
- // If the selection has not changed, do not proceed.
314
- if (selectedReasonID === $selectedReasonOption.val())
315
- return;
316
-
317
- selectedReasonID = $selectedReasonOption.val();
318
-
319
- if ( isAnonymous ) {
320
- if ( isReasonSelected( dontShareDataReasonID ) ) {
321
- $anonymousFeedback.hide();
322
- } else {
323
- $anonymousFeedback.show();
324
- }
325
- }
326
-
327
- var _parent = $(this).parents('li:first');
328
-
329
- $modal.find('.reason-input').remove();
330
- $modal.find( '.internal-message' ).hide();
331
- $modal.find('.button-deactivate').html('<?php echo esc_js( sprintf(
332
- fs_text_inline( 'Submit & %s', 'deactivation-modal-button-submit' , $slug ),
333
- $fs->is_plugin() ?
334
- $deactivate_text :
335
- sprintf( $activate_x_text, $theme_text )
336
- ) ) ?>');
337
-
338
- enableDeactivateButton();
339
-
340
- if ( _parent.hasClass( 'has-internal-message' ) ) {
341
- _parent.find( '.internal-message' ).show();
342
- }
343
-
344
- if (_parent.hasClass('has-input')) {
345
- var inputType = _parent.data('input-type'),
346
- inputPlaceholder = _parent.data('input-placeholder'),
347
- reasonInputHtml = '<div class="reason-input"><span class="message"></span>' + ( ( 'textfield' === inputType ) ? '<input type="text" />' : '<textarea rows="5"></textarea>' ) + '</div>';
348
-
349
- _parent.append($(reasonInputHtml));
350
- _parent.find('input, textarea').attr('placeholder', inputPlaceholder).focus();
351
-
352
- if (isOtherReasonSelected()) {
353
- showMessage('<?php echo esc_js( fs_text_inline( 'Kindly tell us the reason so we can improve.', 'ask-for-reason-message' , $slug ) ); ?>');
354
- disableDeactivateButton();
355
- }
356
- }
357
- });
358
-
359
- // If the user has clicked outside the window, cancel it.
360
- $modal.on('click', function (evt) {
361
- var $target = $(evt.target);
362
-
363
- // If the user has clicked anywhere in the modal dialog, just return.
364
- if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
365
- return;
366
- }
367
-
368
- // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
369
- if (
370
- ! $target.hasClass( 'button-close' ) &&
371
- ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
372
- ) {
373
- return;
374
- }
375
-
376
- closeModal();
377
-
378
- return false;
379
- });
380
- }
381
-
382
- function isAnonymousFeedback() {
383
- if ( ! isAnonymous ) {
384
- return false;
385
- }
386
-
387
- return ( isReasonSelected( dontShareDataReasonID ) || $anonymousFeedback.find( 'input' ).prop( 'checked' ) );
388
- }
389
-
390
- function isReasonSelected( reasonID ) {
391
- // Get the selected radio input element.
392
- var $selectedReasonOption = $modal.find('input[type="radio"]:checked');
393
-
394
- return ( reasonID == $selectedReasonOption.val() );
395
- }
396
-
397
- function isOtherReasonSelected() {
398
- return isReasonSelected( otherReasonID );
399
- }
400
-
401
- function showModal() {
402
- resetModal();
403
-
404
- // Display the dialog box.
405
- $modal.addClass('active');
406
-
407
- $('body').addClass('has-fs-modal');
408
- }
409
-
410
- function closeModal() {
411
- $modal.removeClass('active');
412
-
413
- $('body').removeClass('has-fs-modal');
414
- }
415
-
416
- function resetModal() {
417
- selectedReasonID = false;
418
-
419
- enableDeactivateButton();
420
-
421
- // Uncheck all radio buttons.
422
- $modal.find('input[type="radio"]').prop('checked', false);
423
-
424
- // Remove all input fields ( textfield, textarea ).
425
- $modal.find('.reason-input').remove();
426
-
427
- $modal.find('.message').hide();
428
-
429
- if ( isAnonymous ) {
430
- $anonymousFeedback.find( 'input' ).prop( 'checked', false );
431
-
432
- // Hide, since by default there is no selected reason.
433
- $anonymousFeedback.hide();
434
- }
435
-
436
- var $deactivateButton = $modal.find('.button-deactivate');
437
-
438
- /*
439
- * If the modal dialog has no confirmation message, that is, it has only one panel, then ensure
440
- * that clicking the deactivate button will actually deactivate the plugin.
441
- */
442
- if ( $modal.hasClass( 'no-confirmation-message' ) ) {
443
- $deactivateButton.addClass( 'allow-deactivate' );
444
-
445
- showPanel( 'reasons' );
446
- } else {
447
- $deactivateButton.removeClass( 'allow-deactivate' );
448
-
449
- showPanel( 'confirm' );
450
- }
451
- }
452
-
453
- function showMessage(message) {
454
- $modal.find('.message').text(message).show();
455
- }
456
-
457
- function enableDeactivateButton() {
458
- $modal.find('.button-deactivate').removeClass('disabled');
459
- }
460
-
461
- function disableDeactivateButton() {
462
- $modal.find('.button-deactivate').addClass('disabled');
463
- }
464
-
465
- function showPanel(panelType) {
466
- $modal.find( '.fs-modal-panel' ).removeClass( 'active' );
467
- $modal.find( '[data-panel-id="' + panelType + '"]' ).addClass( 'active' );
468
-
469
- updateButtonLabels();
470
- }
471
-
472
- function updateButtonLabels() {
473
- var $deactivateButton = $modal.find( '.button-deactivate' );
474
-
475
- // Reset the deactivate button's text.
476
- if ( 'confirm' === getCurrentPanel() ) {
477
- $deactivateButton.text( <?php echo json_encode( sprintf(
478
- fs_text_inline( 'Yes - %s', 'deactivation-modal-button-confirm', $slug ),
479
- $fs->is_plugin() ?
480
- $deactivate_text :
481
- sprintf( $activate_x_text, $theme_text )
482
- ) ) ?> );
483
- } else {
484
- $deactivateButton.html( <?php echo json_encode( sprintf(
485
- fs_text_inline('Skip & %s', 'skip-and-x', $slug ),
486
- $fs->is_plugin() ?
487
- $deactivate_text :
488
- sprintf( $activate_x_text, $theme_text )
489
- ) ) ?> );
490
- }
491
- }
492
-
493
- function getCurrentPanel() {
494
- return $modal.find('.fs-modal-panel.active').attr('data-panel-id');
495
- }
496
- })(jQuery);
497
- </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.2
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ */
16
+ $fs = freemius( $VARS['id'] );
17
+ $slug = $fs->get_slug();
18
+
19
+ $confirmation_message = $fs->apply_filters( 'uninstall_confirmation_message', '' );
20
+
21
+ $reasons = $VARS['reasons'];
22
+
23
+ $reasons_list_items_html = '';
24
+
25
+ foreach ( $reasons as $reason ) {
26
+ $list_item_classes = 'reason' . ( ! empty( $reason['input_type'] ) ? ' has-input' : '' );
27
+
28
+ if ( isset( $reason['internal_message'] ) && ! empty( $reason['internal_message'] ) ) {
29
+ $list_item_classes .= ' has-internal-message';
30
+ $reason_internal_message = $reason['internal_message'];
31
+ } else {
32
+ $reason_internal_message = '';
33
+ }
34
+
35
+ $reason_input_type = ( ! empty( $reason['input_type'] ) ? $reason['input_type'] : '' );
36
+ $reason_input_placeholder = ( ! empty( $reason['input_placeholder'] ) ? $reason['input_placeholder'] : '' );
37
+
38
+ $reason_list_item_html = <<< HTML
39
+ <li class="{$list_item_classes}"
40
+ data-input-type="{$reason_input_type}"
41
+ data-input-placeholder="{$reason_input_placeholder}">
42
+ <label>
43
+ <span>
44
+ <input type="radio" name="selected-reason" value="{$reason['id']}"/>
45
+ </span>
46
+ <span>{$reason['text']}</span>
47
+ </label>
48
+ <div class="internal-message">{$reason_internal_message}</div>
49
+ </li>
50
+ HTML;
51
+
52
+ $reasons_list_items_html .= $reason_list_item_html;
53
+ }
54
+
55
+ $is_anonymous = ( ! $fs->is_registered() );
56
+ if ( $is_anonymous ) {
57
+ $anonymous_feedback_checkbox_html = sprintf(
58
+ '<label class="anonymous-feedback-label"><input type="checkbox" class="anonymous-feedback-checkbox"> %s</label>',
59
+ fs_esc_html_inline( 'Anonymous feedback', 'anonymous-feedback', $slug )
60
+ );
61
+ } else {
62
+ $anonymous_feedback_checkbox_html = '';
63
+ }
64
+
65
+ // Aliases.
66
+ $deactivate_text = fs_text_inline( 'Deactivate', 'deactivate', $slug );
67
+ $theme_text = fs_text_inline( 'Theme', 'theme', $slug );
68
+ $activate_x_text = fs_text_inline( 'Activate %s', 'activate-x', $slug );
69
+
70
+ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
71
+ ?>
72
+ <?php $fs->_maybe_add_subscription_cancellation_dialog_box() ?>
73
+ <script type="text/javascript">
74
+ (function ($) {
75
+ var reasonsHtml = <?php echo json_encode( $reasons_list_items_html ) ?>,
76
+ modalHtml =
77
+ '<div class="fs-modal fs-modal-deactivation-feedback<?php echo empty( $confirmation_message ) ? ' no-confirmation-message' : ''; ?>">'
78
+ + ' <div class="fs-modal-dialog">'
79
+ + ' <div class="fs-modal-header">'
80
+ + ' <h4><?php fs_esc_attr_echo_inline( 'Quick Feedback', 'quick-feedback' , $slug ) ?></h4>'
81
+ + ' </div>'
82
+ + ' <div class="fs-modal-body">'
83
+ + ' <div class="fs-modal-panel" data-panel-id="confirm"><p><?php echo $confirmation_message; ?></p></div>'
84
+ + ' <div class="fs-modal-panel active" data-panel-id="reasons"><h3><strong><?php echo esc_js( sprintf( fs_text_inline( 'If you have a moment, please let us know why you are %s', 'deactivation-share-reason' , $slug ), ( $fs->is_plugin() ? fs_text_inline( 'deactivating', 'deactivating', $slug ) : fs_text_inline( 'switching', 'switching', $slug ) ) ) ) ?>:</strong></h3><ul id="reasons-list">' + reasonsHtml + '</ul></div>'
85
+ + ' </div>'
86
+ + ' <div class="fs-modal-footer">'
87
+ + ' <?php echo $anonymous_feedback_checkbox_html ?>'
88
+ + ' <a href="#" class="button button-secondary button-deactivate"></a>'
89
+ + ' <a href="#" class="button button-primary button-close"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>'
90
+ + ' </div>'
91
+ + ' </div>'
92
+ + '</div>',
93
+ $modal = $(modalHtml),
94
+ $deactivateLink = $('#the-list .deactivate > [data-module-id=<?php echo $fs->get_id() ?>].fs-module-id').prev(),
95
+ selectedReasonID = false,
96
+ redirectLink = '',
97
+ $anonymousFeedback = $modal.find( '.anonymous-feedback-label' ),
98
+ isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
99
+ otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
100
+ dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
101
+ deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>,
102
+ $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' );
103
+
104
+ $modal.appendTo($('body'));
105
+
106
+ if ( 0 !== $subscriptionCancellationModal.length ) {
107
+ $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
108
+ if ( false === cancelSubscription ) {
109
+ showModal();
110
+
111
+ $subscriptionCancellationModal.trigger( 'closeModal' );
112
+ } else {
113
+ var $errorMessage = $subscriptionCancellationModal.find( '.notice-error' );
114
+
115
+ <?php
116
+ $subscription_cancellation_context = $fs->is_paid_trial() ?
117
+ fs_text_inline( 'trial', 'trial', $slug ) :
118
+ fs_text_inline( 'subscription', 'subscription', $slug );
119
+ ?>
120
+
121
+ $.ajax({
122
+ url : ajaxurl,
123
+ method : 'POST',
124
+ data : {
125
+ action : '<?php echo $fs->get_ajax_action( 'cancel_subscription_or_trial' ) ?>',
126
+ security : '<?php echo $fs->get_ajax_security( 'cancel_subscription_or_trial' ) ?>',
127
+ module_id: '<?php echo $fs->get_id() ?>'
128
+ },
129
+ beforeSend: function() {
130
+ $errorMessage.hide();
131
+
132
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
133
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js(
134
+ sprintf( fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ), $subscription_cancellation_context )
135
+ ) ?>' );
136
+ },
137
+ success: function( result ) {
138
+ if ( result.success ) {
139
+ $subscriptionCancellationModal.removeClass( 'has-subscription-actions' );
140
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).removeClass( 'warn' );
141
+
142
+ $subscriptionCancellationModal.remove();
143
+ showModal();
144
+ } else {
145
+ $errorMessage.find( '> p' ).html( result.error );
146
+ $errorMessage.show();
147
+
148
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).removeClass( 'disabled' );
149
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).html( <?php echo json_encode( sprintf(
150
+ fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
151
+ ucfirst( $subscription_cancellation_context )
152
+ ) ) ?> );
153
+ }
154
+ }
155
+ });
156
+ }
157
+ });
158
+ }
159
+
160
+ registerEventHandlers();
161
+
162
+ function registerEventHandlers() {
163
+ $deactivateLink.click(function (evt) {
164
+ evt.preventDefault();
165
+
166
+ redirectLink = $(this).attr('href');
167
+
168
+ if ( 0 == $subscriptionCancellationModal.length ) {
169
+ showModal();
170
+ } else {
171
+ $subscriptionCancellationModal.trigger( 'showModal' );
172
+ }
173
+ });
174
+
175
+ <?php
176
+ if ( ! $fs->is_plugin() ) {
177
+ /**
178
+ * For "theme" module type, the modal is shown when the current user clicks on
179
+ * the "Activate" button of any other theme. The "Activate" button is actually
180
+ * a link to the "Themes" page (/wp-admin/themes.php) containing query params
181
+ * that tell WordPress to deactivate the current theme and activate a different theme.
182
+ *
183
+ * @author Leo Fajardo (@leorw)
184
+ * @since 1.2.2
185
+ *
186
+ * @since 1.2.2.7 Don't trigger the deactivation feedback form if activating the premium version of the theme.
187
+ */
188
+ ?>
189
+ $('body').on('click', '.theme-browser .theme:not([data-slug=<?php echo $fs->get_premium_slug() ?>]) .theme-actions .button.activate', function (evt) {
190
+ evt.preventDefault();
191
+
192
+ redirectLink = $(this).attr('href');
193
+
194
+ showModal();
195
+ });
196
+ <?php
197
+ } ?>
198
+
199
+ $modal.on('input propertychange', '.reason-input input', function () {
200
+ if (!isOtherReasonSelected()) {
201
+ return;
202
+ }
203
+
204
+ var reason = $(this).val().trim();
205
+
206
+ /**
207
+ * If reason is not empty, remove the error-message class of the message container
208
+ * to change the message color back to default.
209
+ */
210
+ if (reason.length > 0) {
211
+ $('.message').removeClass('error-message');
212
+ enableDeactivateButton();
213
+ }
214
+ });
215
+
216
+ $modal.on('blur', '.reason-input input', function () {
217
+ var $userReason = $(this);
218
+
219
+ setTimeout(function () {
220
+ if (!isOtherReasonSelected()) {
221
+ return;
222
+ }
223
+
224
+ /**
225
+ * If reason is empty, add the error-message class to the message container
226
+ * to change the message color to red.
227
+ */
228
+ if (0 === $userReason.val().trim().length) {
229
+ $('.message').addClass('error-message');
230
+ disableDeactivateButton();
231
+ }
232
+ }, 150);
233
+ });
234
+
235
+ $modal.on('click', '.fs-modal-footer .button', function (evt) {
236
+ evt.preventDefault();
237
+
238
+ if ($(this).hasClass('disabled')) {
239
+ return;
240
+ }
241
+
242
+ var _parent = $(this).parents('.fs-modal:first');
243
+ var _this = $(this);
244
+
245
+ if (_this.hasClass('allow-deactivate')) {
246
+ var $radio = $('input[type="radio"]:checked');
247
+
248
+ if (0 === $radio.length) {
249
+ if ( ! deleteThemeUpdateData ) {
250
+ // If no selected reason, just deactivate the plugin.
251
+ window.location.href = redirectLink;
252
+ } else {
253
+ $.ajax({
254
+ url : ajaxurl,
255
+ method : 'POST',
256
+ data : {
257
+ action : '<?php echo $fs->get_ajax_action( 'delete_theme_update_data' ) ?>',
258
+ security : '<?php echo $fs->get_ajax_security( 'delete_theme_update_data' ) ?>',
259
+ module_id: '<?php echo $fs->get_id() ?>'
260
+ },
261
+ beforeSend: function() {
262
+ _parent.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
263
+ _parent.find( '.fs-modal-footer .button-secondary' ).text( 'Processing...' );
264
+ },
265
+ complete : function() {
266
+ window.location.href = redirectLink;
267
+ }
268
+ });
269
+ }
270
+
271
+ return;
272
+ }
273
+
274
+ var $selected_reason = $radio.parents('li:first'),
275
+ $input = $selected_reason.find('textarea, input[type="text"]'),
276
+ userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
277
+
278
+ if (isOtherReasonSelected() && ( '' === userReason )) {
279
+ return;
280
+ }
281
+
282
+ $.ajax({
283
+ url : ajaxurl,
284
+ method : 'POST',
285
+ data : {
286
+ action : '<?php echo $fs->get_ajax_action( 'submit_uninstall_reason' ) ?>',
287
+ security : '<?php echo $fs->get_ajax_security( 'submit_uninstall_reason' ) ?>',
288
+ module_id : '<?php echo $fs->get_id() ?>',
289
+ reason_id : $radio.val(),
290
+ reason_info : userReason,
291
+ is_anonymous: isAnonymousFeedback()
292
+ },
293
+ beforeSend: function () {
294
+ _parent.find('.fs-modal-footer .button').addClass('disabled');
295
+ _parent.find('.fs-modal-footer .button-secondary').text('Processing...');
296
+ },
297
+ complete : function () {
298
+ // Do not show the dialog box, deactivate the plugin.
299
+ window.location.href = redirectLink;
300
+ }
301
+ });
302
+ } else if (_this.hasClass('button-deactivate')) {
303
+ // Change the Deactivate button's text and show the reasons panel.
304
+ _parent.find('.button-deactivate').addClass('allow-deactivate');
305
+
306
+ showPanel('reasons');
307
+ }
308
+ });
309
+
310
+ $modal.on('click', 'input[type="radio"]', function () {
311
+ var $selectedReasonOption = $( this );
312
+
313
+ // If the selection has not changed, do not proceed.
314
+ if (selectedReasonID === $selectedReasonOption.val())
315
+ return;
316
+
317
+ selectedReasonID = $selectedReasonOption.val();
318
+
319
+ if ( isAnonymous ) {
320
+ if ( isReasonSelected( dontShareDataReasonID ) ) {
321
+ $anonymousFeedback.hide();
322
+ } else {
323
+ $anonymousFeedback.show();
324
+ }
325
+ }
326
+
327
+ var _parent = $(this).parents('li:first');
328
+
329
+ $modal.find('.reason-input').remove();
330
+ $modal.find( '.internal-message' ).hide();
331
+ $modal.find('.button-deactivate').html('<?php echo esc_js( sprintf(
332
+ fs_text_inline( 'Submit & %s', 'deactivation-modal-button-submit' , $slug ),
333
+ $fs->is_plugin() ?
334
+ $deactivate_text :
335
+ sprintf( $activate_x_text, $theme_text )
336
+ ) ) ?>');
337
+
338
+ enableDeactivateButton();
339
+
340
+ if ( _parent.hasClass( 'has-internal-message' ) ) {
341
+ _parent.find( '.internal-message' ).show();
342
+ }
343
+
344
+ if (_parent.hasClass('has-input')) {
345
+ var inputType = _parent.data('input-type'),
346
+ inputPlaceholder = _parent.data('input-placeholder'),
347
+ reasonInputHtml = '<div class="reason-input"><span class="message"></span>' + ( ( 'textfield' === inputType ) ? '<input type="text" />' : '<textarea rows="5"></textarea>' ) + '</div>';
348
+
349
+ _parent.append($(reasonInputHtml));
350
+ _parent.find('input, textarea').attr('placeholder', inputPlaceholder).focus();
351
+
352
+ if (isOtherReasonSelected()) {
353
+ showMessage('<?php echo esc_js( fs_text_inline( 'Kindly tell us the reason so we can improve.', 'ask-for-reason-message' , $slug ) ); ?>');
354
+ disableDeactivateButton();
355
+ }
356
+ }
357
+ });
358
+
359
+ // If the user has clicked outside the window, cancel it.
360
+ $modal.on('click', function (evt) {
361
+ var $target = $(evt.target);
362
+
363
+ // If the user has clicked anywhere in the modal dialog, just return.
364
+ if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
365
+ return;
366
+ }
367
+
368
+ // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
369
+ if (
370
+ ! $target.hasClass( 'button-close' ) &&
371
+ ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
372
+ ) {
373
+ return;
374
+ }
375
+
376
+ closeModal();
377
+
378
+ return false;
379
+ });
380
+ }
381
+
382
+ function isAnonymousFeedback() {
383
+ if ( ! isAnonymous ) {
384
+ return false;
385
+ }
386
+
387
+ return ( isReasonSelected( dontShareDataReasonID ) || $anonymousFeedback.find( 'input' ).prop( 'checked' ) );
388
+ }
389
+
390
+ function isReasonSelected( reasonID ) {
391
+ // Get the selected radio input element.
392
+ var $selectedReasonOption = $modal.find('input[type="radio"]:checked');
393
+
394
+ return ( reasonID == $selectedReasonOption.val() );
395
+ }
396
+
397
+ function isOtherReasonSelected() {
398
+ return isReasonSelected( otherReasonID );
399
+ }
400
+
401
+ function showModal() {
402
+ resetModal();
403
+
404
+ // Display the dialog box.
405
+ $modal.addClass('active');
406
+
407
+ $('body').addClass('has-fs-modal');
408
+ }
409
+
410
+ function closeModal() {
411
+ $modal.removeClass('active');
412
+
413
+ $('body').removeClass('has-fs-modal');
414
+ }
415
+
416
+ function resetModal() {
417
+ selectedReasonID = false;
418
+
419
+ enableDeactivateButton();
420
+
421
+ // Uncheck all radio buttons.
422
+ $modal.find('input[type="radio"]').prop('checked', false);
423
+
424
+ // Remove all input fields ( textfield, textarea ).
425
+ $modal.find('.reason-input').remove();
426
+
427
+ $modal.find('.message').hide();
428
+
429
+ if ( isAnonymous ) {
430
+ $anonymousFeedback.find( 'input' ).prop( 'checked', false );
431
+
432
+ // Hide, since by default there is no selected reason.
433
+ $anonymousFeedback.hide();
434
+ }
435
+
436
+ var $deactivateButton = $modal.find('.button-deactivate');
437
+
438
+ /*
439
+ * If the modal dialog has no confirmation message, that is, it has only one panel, then ensure
440
+ * that clicking the deactivate button will actually deactivate the plugin.
441
+ */
442
+ if ( $modal.hasClass( 'no-confirmation-message' ) ) {
443
+ $deactivateButton.addClass( 'allow-deactivate' );
444
+
445
+ showPanel( 'reasons' );
446
+ } else {
447
+ $deactivateButton.removeClass( 'allow-deactivate' );
448
+
449
+ showPanel( 'confirm' );
450
+ }
451
+ }
452
+
453
+ function showMessage(message) {
454
+ $modal.find('.message').text(message).show();
455
+ }
456
+
457
+ function enableDeactivateButton() {
458
+ $modal.find('.button-deactivate').removeClass('disabled');
459
+ }
460
+
461
+ function disableDeactivateButton() {
462
+ $modal.find('.button-deactivate').addClass('disabled');
463
+ }
464
+
465
+ function showPanel(panelType) {
466
+ $modal.find( '.fs-modal-panel' ).removeClass( 'active' );
467
+ $modal.find( '[data-panel-id="' + panelType + '"]' ).addClass( 'active' );
468
+
469
+ updateButtonLabels();
470
+ }
471
+
472
+ function updateButtonLabels() {
473
+ var $deactivateButton = $modal.find( '.button-deactivate' );
474
+
475
+ // Reset the deactivate button's text.
476
+ if ( 'confirm' === getCurrentPanel() ) {
477
+ $deactivateButton.text( <?php echo json_encode( sprintf(
478
+ fs_text_inline( 'Yes - %s', 'deactivation-modal-button-confirm', $slug ),
479
+ $fs->is_plugin() ?
480
+ $deactivate_text :
481
+ sprintf( $activate_x_text, $theme_text )
482
+ ) ) ?> );
483
+ } else {
484
+ $deactivateButton.html( <?php echo json_encode( sprintf(
485
+ fs_text_inline('Skip & %s', 'skip-and-x', $slug ),
486
+ $fs->is_plugin() ?
487
+ $deactivate_text :
488
+ sprintf( $activate_x_text, $theme_text )
489
+ ) ) ?> );
490
+ }
491
+ }
492
+
493
+ function getCurrentPanel() {
494
+ return $modal.find('.fs-modal-panel.active').attr('data-panel-id');
495
+ }
496
+ })(jQuery);
497
+ </script>
includes/functions.php CHANGED
@@ -758,7 +758,6 @@ function aiovg_get_default_settings() {
758
  'fullscreen' => 'fullscreen'
759
  ),
760
  'use_native_controls' => array(
761
- 'vimeo' => 'vimeo',
762
  'dailymotion' => 'dailymotion',
763
  'facebook' => 'facebook'
764
  )
@@ -973,7 +972,6 @@ function aiovg_get_page_number() {
973
  function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
974
  // Vars
975
  $player_settings = get_option( 'aiovg_player_settings' );
976
- $privacy_settings = get_option( 'aiovg_privacy_settings' );
977
 
978
  $attributes = array_merge( array(
979
  'width' => $player_settings['width'],
@@ -998,47 +996,17 @@ function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
998
  ), $atts );
999
 
1000
  $url = aiovg_get_player_page_url( $post_id, $attributes );
1001
-
1002
- $show_consent = 0;
1003
- if ( ! isset( $_COOKIE['aiovg_gdpr_consent'] ) && ! empty( $privacy_settings['show_consent'] ) && ! empty( $privacy_settings['consent_message'] ) && ! empty( $privacy_settings['consent_button_label'] ) ) {
1004
- $show_consent = 1;
1005
- }
1006
 
1007
  // Process output
1008
  $html = '';
1009
 
1010
  if ( ! empty( $url ) ) {
1011
- $url = esc_url( $url );
1012
- $iframe = sprintf( '<iframe width="560" height="315" src="%s" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>', $url );
1013
-
1014
- if ( $show_consent ) {
1015
- $url_parts = explode( '?' , $url );
1016
-
1017
- $is_youtube = ( false !== strpos( $url_parts[0], 'youtube.com' ) );
1018
- $is_vimeo = ( false !== strpos( $url_parts[0], 'vimeo.com' ) );
1019
- $is_dailymotion = ( false !== strpos( $url_parts[0], 'dailymotion.com' ) );
1020
- $is_facebook = ( false !== strpos( $url_parts[0], 'facebook.com' ) );
1021
-
1022
- if ( $is_youtube || $is_vimeo || $is_dailymotion || $is_facebook ) {
1023
- $video = add_query_arg( 'autoplay', 1, $url );
1024
-
1025
- $image = '';
1026
- if ( $post_id > 0 ) {
1027
- $post_meta = get_post_meta( $post_id );
1028
- $image = aiovg_get_image_url( $post_meta['image_id'][0], 'large', $post_meta['image'][0], 'player' );
1029
- }
1030
-
1031
- $iframe = sprintf( '<iframe width="560" height="315" data-src="%s" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>', $video );
1032
- $iframe .= sprintf( '<div class="aiovg-privacy-wrapper" style="background-image: url(%s);">', $image );
1033
- $iframe .= '<div class="aiovg-privacy-consent-block">';
1034
- $iframe .= sprintf( '<div class="aiovg-privacy-consent-message">%s</div>', wp_kses_post( $privacy_settings['consent_message'] ) );
1035
- $iframe .= sprintf( '<div class="aiovg-privacy-consent-button">%s</div>', sanitize_text_field( $privacy_settings['consent_button_label'] ) );
1036
- $iframe .= '</div>';
1037
- $iframe .= '</div>';
1038
- }
1039
- }
1040
 
1041
- $html = sprintf(
1042
  '<div class="aiovg-player-container" style="max-width: %s;"><div class="aiovg-player" style="padding-bottom: %s;">%s</div></div>',
1043
  ! empty( $attributes['width'] ) ? (int) $attributes['width'] . 'px' : '100%',
1044
  ! empty( $attributes['ratio'] ) ? (float) $attributes['ratio'] . '%' : '56.25%',
@@ -1059,7 +1027,6 @@ function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
1059
  * @return string $url Player page URL.
1060
  */
1061
  function aiovg_get_player_page_url( $post_id = 0, $atts = array() ) {
1062
- $player_settings = get_option( 'aiovg_player_settings' );
1063
  $page_settings = get_option( 'aiovg_page_settings' );
1064
 
1065
  $url = '';
@@ -1120,74 +1087,6 @@ function aiovg_get_player_page_url( $post_id = 0, $atts = array() ) {
1120
  $url = add_query_arg( $query_args, $url );
1121
  }
1122
 
1123
- // Overwrite URL for embedded sources
1124
- $embedded_sources = array( 'youtube', 'vimeo', 'dailymotion', 'facebook' );
1125
-
1126
- if ( $post_id > 0 ) {
1127
- $type = get_post_meta( $post_id, 'type', true );
1128
-
1129
- if ( 'embedcode' == $type ) {
1130
- $embedcode = get_post_meta( $post_id, 'embedcode', true );
1131
-
1132
- $document = new DOMDocument();
1133
- $document->loadHTML( $embedcode );
1134
-
1135
- $iframes = $document->getElementsByTagName( 'iframe' );
1136
- $url = $iframes->item(0)->getAttribute( 'src' );
1137
- } elseif ( in_array( $type, $embedded_sources ) && isset( $player_settings['use_native_controls'][ $type ] ) ) {
1138
- if ( ! array_key_exists( $type, $query_args ) ) {
1139
- $query_args[ $type ] = get_post_meta( $post_id, $type, true );
1140
- }
1141
- }
1142
- }
1143
-
1144
- foreach ( $embedded_sources as $source ) {
1145
- if ( array_key_exists( $source, $query_args ) && isset( $player_settings['use_native_controls'][ $source ] ) ) {
1146
- switch ( $source ) {
1147
- case 'youtube':
1148
- $url = 'https://www.youtube.com/embed/' . aiovg_get_youtube_id_from_url( urldecode( $query_args['youtube'] ) ) . '?showinfo=0&rel=0&iv_load_policy=3';
1149
- break;
1150
- case 'vimeo':
1151
- $url = 'https://player.vimeo.com/video/' . aiovg_get_vimeo_id_from_url( urldecode( $query_args['vimeo'] ) ) . '?title=0&byline=0&portrait=0';
1152
- break;
1153
- case 'dailymotion':
1154
- $url = 'https://www.dailymotion.com/embed/video/' . aiovg_get_dailymotion_id_from_url( urldecode( $query_args['dailymotion'] ) ) . '?queue-autoplay-next=0&queue-enable=0&sharing-enable=0&ui-logo=0&ui-start-screen-info=0';
1155
- break;
1156
- case 'facebook':
1157
- $url = 'https://www.facebook.com/plugins/video.php?href=' . urlencode( urldecode( $query_args['facebook'] ) ) . '&width=560&height=315&show_text=false&appId';
1158
- break;
1159
- }
1160
-
1161
- $features = array( 'playpause', 'current', 'progress', 'duration', 'volume', 'fullscreen' );
1162
- $controls = array();
1163
- foreach ( $features as $feature ) {
1164
- if ( array_key_exists( $feature, $query_args ) ) {
1165
- if ( 1 == (int) $query_args[ $feature ] ) {
1166
- $controls[] = $feature;
1167
- }
1168
- } else {
1169
- if ( isset( $player_settings['controls'][ $feature ] ) ) {
1170
- $controls[] = $feature;
1171
- }
1172
- }
1173
- }
1174
-
1175
- if ( empty( $controls ) ) {
1176
- $url = add_query_arg( 'controls', 0, $url );
1177
- } else {
1178
- if ( ! array_key_exists( 'fullscreen', $controls ) ) {
1179
- $url = add_query_arg( 'fs', 0, $url );
1180
- }
1181
- }
1182
-
1183
- $autoplay = array_key_exists( 'autoplay', $query_args ) ? $query_args['autoplay'] : $player_settings['autoplay'];
1184
- $url = add_query_arg( 'autoplay', (int) $autoplay, $url );
1185
-
1186
- $loop = array_key_exists( 'loop', $query_args ) ? $query_args['loop'] : $player_settings['loop'];
1187
- $url = add_query_arg( 'loop', (int) $loop, $url );
1188
- }
1189
- }
1190
-
1191
  // Return
1192
  return apply_filters( 'aiovg_player_page_url', $url, $post_id, $atts );
1193
  }
@@ -1622,14 +1521,6 @@ function the_aiovg_pagination( $numpages = '', $pagerange = '', $paged = '' ) {
1622
  */
1623
  function the_aiovg_player( $post_id = 0, $atts = array() ) {
1624
  echo aiovg_get_player_html( $post_id, $atts );
1625
-
1626
- // Update views count for Iframe Embed Codes
1627
- if ( $post_id > 0 ) {
1628
- $type = get_post_meta( $post_id, 'type', true );
1629
- if ( 'embedcode' == $type ) {
1630
- aiovg_update_views_count( $post_id );
1631
- }
1632
- }
1633
  }
1634
 
1635
  /**
758
  'fullscreen' => 'fullscreen'
759
  ),
760
  'use_native_controls' => array(
 
761
  'dailymotion' => 'dailymotion',
762
  'facebook' => 'facebook'
763
  )
972
  function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
973
  // Vars
974
  $player_settings = get_option( 'aiovg_player_settings' );
 
975
 
976
  $attributes = array_merge( array(
977
  'width' => $player_settings['width'],
996
  ), $atts );
997
 
998
  $url = aiovg_get_player_page_url( $post_id, $attributes );
 
 
 
 
 
999
 
1000
  // Process output
1001
  $html = '';
1002
 
1003
  if ( ! empty( $url ) ) {
1004
+ $iframe = sprintf(
1005
+ '<iframe width="560" height="315" src="%s" frameborder="0" scrolling="no" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',
1006
+ esc_url( $url )
1007
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
 
1009
+ $html = sprintf(
1010
  '<div class="aiovg-player-container" style="max-width: %s;"><div class="aiovg-player" style="padding-bottom: %s;">%s</div></div>',
1011
  ! empty( $attributes['width'] ) ? (int) $attributes['width'] . 'px' : '100%',
1012
  ! empty( $attributes['ratio'] ) ? (float) $attributes['ratio'] . '%' : '56.25%',
1027
  * @return string $url Player page URL.
1028
  */
1029
  function aiovg_get_player_page_url( $post_id = 0, $atts = array() ) {
 
1030
  $page_settings = get_option( 'aiovg_page_settings' );
1031
 
1032
  $url = '';
1087
  $url = add_query_arg( $query_args, $url );
1088
  }
1089
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1090
  // Return
1091
  return apply_filters( 'aiovg_player_page_url', $url, $post_id, $atts );
1092
  }
1521
  */
1522
  function the_aiovg_player( $post_id = 0, $atts = array() ) {
1523
  echo aiovg_get_player_html( $post_id, $atts );
 
 
 
 
 
 
 
 
1524
  }
1525
 
1526
  /**
languages/all-in-one-video-gallery.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: All-in-One Video Gallery\n"
4
- "POT-Creation-Date: 2019-02-15 10:00+0530\n"
5
- "PO-Revision-Date: 2019-02-15 10:00+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: en_US\n"
@@ -113,7 +113,7 @@ msgid "Categories list navigation"
113
  msgstr ""
114
 
115
  #: admin/categories.php:124 admin/settings.php:331 admin/videos.php:393
116
- #: blocks/blocks.php:81 includes/functions.php:282
117
  #: widgets/forms/categories.php:64
118
  msgid "ID"
119
  msgstr ""
@@ -186,7 +186,7 @@ msgid "OGV"
186
  msgstr ""
187
 
188
  #: admin/partials/video-sources.php:92 admin/partials/video-sources.php:95
189
- #: admin/settings.php:279 includes/functions.php:1263
190
  msgid "YouTube"
191
  msgstr ""
192
 
@@ -195,7 +195,7 @@ msgid "Example: https://www.youtube.com/watch?v=twYp6W6vt2U"
195
  msgstr ""
196
 
197
  #: admin/partials/video-sources.php:103 admin/partials/video-sources.php:106
198
- #: admin/settings.php:280 includes/functions.php:1264
199
  msgid "Vimeo"
200
  msgstr ""
201
 
@@ -204,7 +204,7 @@ msgid "Example: https://vimeo.com/108018156"
204
  msgstr ""
205
 
206
  #: admin/partials/video-sources.php:114 admin/partials/video-sources.php:117
207
- #: admin/settings.php:281 includes/functions.php:1265
208
  msgid "Dailymotion"
209
  msgstr ""
210
 
@@ -213,8 +213,8 @@ msgid "Example: https://www.dailymotion.com/video/x11prnt"
213
  msgstr ""
214
 
215
  #: admin/partials/video-sources.php:125 admin/partials/video-sources.php:128
216
- #: admin/settings.php:282 admin/settings.php:502 includes/functions.php:1266
217
- #: includes/functions.php:1663
218
  msgid "Facebook"
219
  msgstr ""
220
 
@@ -231,7 +231,7 @@ msgid "Enter your Iframe Embed Code here"
231
  msgstr ""
232
 
233
  #: admin/partials/video-sources.php:160 admin/partials/video-sources.php:163
234
- #: admin/settings.php:266 blocks/blocks.php:121 includes/functions.php:599
235
  #: widgets/forms/video.php:84
236
  msgid "Duration"
237
  msgstr ""
@@ -294,100 +294,75 @@ msgstr ""
294
 
295
  #: admin/partials/welcome.php:15
296
  #, php-format
297
- msgid "Welcome to \"All-in-One Video Gallery - %s\""
298
  msgstr ""
299
 
300
  #: admin/partials/welcome.php:18
301
- msgid "No coding required. A Responsive & Lightweight video gallery plugin."
302
  msgstr ""
303
 
304
- #: admin/partials/welcome.php:22
305
- msgid ""
306
- "HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery "
307
- "Builder (Gutenberg), forms to Search Videos, Social Sharing and everything "
308
- "you will need to build a YouTube/Vimeo like video sharing website."
309
- msgstr ""
310
-
311
- #: admin/partials/welcome.php:38
312
- msgid ""
313
- "Supports any browser & video formats such as MP4, WebM, OGV and embeddable "
314
- "players like YouTube, Vimeo, Dailymotion, Facebook, etc."
315
- msgstr ""
316
-
317
- #: admin/partials/welcome.php:48
318
- msgid "Configure Settings"
319
- msgstr ""
320
-
321
- #: admin/partials/welcome.php:53
322
- msgid ""
323
- "100+ Settings. Configure player options like \"Autoplay\", \"Loop\", "
324
- "\"Preload\" and gallery options like \"Number of Columns\", \"Pagination\", "
325
- "\"Comments\", etc."
326
- msgstr ""
327
-
328
- #: admin/partials/welcome.php:62
329
- msgid "Categories &rarr; Add"
330
  msgstr ""
331
 
332
- #: admin/partials/welcome.php:67
333
- msgid ""
334
- "Create unlimited categories and subcategory levels. Categories allow you to "
335
- "organize your videos in a way that makes it easy for your users to find "
336
- "exactly what they're looking for."
337
  msgstr ""
338
 
 
 
339
  #: admin/partials/welcome.php:76
340
- msgid "Video Gallery &rarr; Add New"
 
341
  msgstr ""
342
 
343
- #: admin/partials/welcome.php:81
344
- msgid ""
345
- "Add unlimited videos. \"All-in-One Video Gallery\" videos are CUSTOM POST "
346
- "TYPE called \"aiovg_videos\". So, each video is a POST. This makes the "
347
- "gallery more powerful and the possibility of extending the plugin is huge."
348
  msgstr ""
349
 
350
- #: admin/partials/welcome.php:89
351
- msgid "Front-End Gallery Display"
352
  msgstr ""
353
 
354
- #: admin/partials/welcome.php:93
355
- msgid ""
356
- "100% Gutenberg compatible. Visually build your gallery using the plugin's "
357
- "Gutenberg Blocks. There is a Shortcode Builder for the old classic WP Editor."
358
  msgstr ""
359
 
360
- #: admin/partials/welcome.php:101
361
- msgid "Configure Sidebars"
362
  msgstr ""
363
 
364
- #: admin/partials/welcome.php:105
 
365
  msgid ""
366
- "Decorate your website sidebars using our Widgets. There are separate Widgets "
367
- "available for categories display, video gallery, single video player, search "
368
- "form, etc."
369
  msgstr ""
370
 
371
- #: admin/partials/welcome.php:113
372
- msgid "More Features"
 
 
 
373
  msgstr ""
374
 
375
- #: admin/partials/welcome.php:117
 
376
  msgid ""
377
- "There is a PREMIUM version with even more powerful features like Custom Logo "
378
- "& Branding, HLS / M(PEG)-Dash support, Live Streaming, Popup Gallery, Videos "
379
- "Slider, VAST / VPAID Ads, etc."
380
  msgstr ""
381
 
382
- #: admin/partials/welcome.php:125
383
  msgid "Need Help?"
384
  msgstr ""
385
 
386
- #: admin/partials/welcome.php:130
387
  msgid "Phenomenal Support"
388
  msgstr ""
389
 
390
- #: admin/partials/welcome.php:133
391
  #, php-format
392
  msgid ""
393
  "We do our best to provide the best support we can. If you encounter a "
@@ -395,11 +370,11 @@ msgid ""
395
  "\"%s\" target=\"_blank\">support form</a>."
396
  msgstr ""
397
 
398
- #: admin/partials/welcome.php:138
399
  msgid "Need Even Faster Support?"
400
  msgstr ""
401
 
402
- #: admin/partials/welcome.php:141
403
  #, php-format
404
  msgid ""
405
  "Our <a href=\"%s\" target=\"_blank\">Priority Support</a> system is there "
@@ -418,9 +393,9 @@ msgstr ""
418
  msgid "Advanced"
419
  msgstr ""
420
 
421
- #: admin/settings.php:117 blocks/blocks.php:106 includes/functions.php:231
422
- #: includes/functions.php:333 includes/functions.php:534
423
- #: includes/functions.php:630
424
  msgid "General Settings"
425
  msgstr ""
426
 
@@ -492,7 +467,7 @@ msgid ""
492
  msgstr ""
493
 
494
  #: admin/settings.php:203 admin/settings.php:290 blocks/blocks.php:107
495
- #: includes/functions.php:545 premium/widgets/forms/companion.php:15
496
  #: widgets/forms/video.php:46
497
  msgid "Width"
498
  msgstr ""
@@ -505,8 +480,8 @@ msgid ""
505
  msgstr ""
506
 
507
  #: admin/settings.php:210 admin/settings.php:297 blocks/blocks.php:109
508
- #: includes/functions.php:261 includes/functions.php:419
509
- #: includes/functions.php:552 widgets/forms/video.php:51
510
  msgid "Ratio"
511
  msgstr ""
512
 
@@ -544,7 +519,7 @@ msgstr ""
544
  msgid "Cinemascope"
545
  msgstr ""
546
 
547
- #: admin/settings.php:227 blocks/blocks.php:111 includes/functions.php:559
548
  #: widgets/forms/video.php:57
549
  msgid "Autoplay"
550
  msgstr ""
@@ -553,7 +528,7 @@ msgstr ""
553
  msgid "Check this to start playing the video as soon as it is ready"
554
  msgstr ""
555
 
556
- #: admin/settings.php:234 blocks/blocks.php:112 includes/functions.php:566
557
  #: widgets/forms/video.php:62
558
  msgid "Loop"
559
  msgstr ""
@@ -596,37 +571,37 @@ msgstr ""
596
  msgid "None"
597
  msgstr ""
598
 
599
- #: admin/settings.php:259 blocks/blocks.php:117 includes/functions.php:574
600
  #: widgets/forms/video.php:65
601
  msgid "Player Controls"
602
  msgstr ""
603
 
604
- #: admin/settings.php:263 blocks/blocks.php:118 includes/functions.php:578
605
  #: widgets/forms/video.php:69
606
  msgid "Play / Pause"
607
  msgstr ""
608
 
609
- #: admin/settings.php:264 blocks/blocks.php:119 includes/functions.php:585
610
  #: widgets/forms/video.php:74
611
  msgid "Current Time"
612
  msgstr ""
613
 
614
- #: admin/settings.php:265 blocks/blocks.php:120 includes/functions.php:592
615
  #: widgets/forms/video.php:79
616
  msgid "Progressbar"
617
  msgstr ""
618
 
619
- #: admin/settings.php:267 admin/videos.php:143 includes/functions.php:606
620
  #: widgets/forms/video.php:89
621
  msgid "Subtitles"
622
  msgstr ""
623
 
624
- #: admin/settings.php:268 blocks/blocks.php:122 includes/functions.php:613
625
  #: widgets/forms/video.php:94
626
  msgid "Volume"
627
  msgstr ""
628
 
629
- #: admin/settings.php:269 blocks/blocks.php:123 includes/functions.php:620
630
  #: widgets/forms/video.php:99
631
  msgid "Fullscreen"
632
  msgstr ""
@@ -655,24 +630,24 @@ msgid ""
655
  msgstr ""
656
 
657
  #: admin/settings.php:306 admin/settings.php:381 blocks/blocks.php:76
658
- #: includes/functions.php:242 includes/functions.php:344
659
- #: includes/functions.php:634 widgets/forms/categories.php:39
660
  #: widgets/forms/search.php:20
661
  msgid "Select Template"
662
  msgstr ""
663
 
664
- #: admin/settings.php:310 blocks/blocks.php:77 includes/functions.php:246
665
  #: widgets/forms/categories.php:43
666
  msgid "Grid"
667
  msgstr ""
668
 
669
- #: admin/settings.php:311 blocks/blocks.php:78 includes/functions.php:247
670
  #: widgets/forms/categories.php:44
671
  msgid "List"
672
  msgstr ""
673
 
674
  #: admin/settings.php:317 admin/settings.php:389 blocks/blocks.php:79
675
- #: includes/functions.php:268 includes/functions.php:426
676
  #: widgets/forms/categories.php:55
677
  msgid "Columns"
678
  msgstr ""
@@ -685,23 +660,23 @@ msgstr ""
685
  msgid "Order by"
686
  msgstr ""
687
 
688
- #: admin/settings.php:332 blocks/blocks.php:82 includes/functions.php:283
689
  #: widgets/forms/categories.php:65
690
  msgid "Count"
691
  msgstr ""
692
 
693
- #: admin/settings.php:333 blocks/blocks.php:83 includes/functions.php:284
694
  #: widgets/forms/categories.php:66
695
  msgid "Name"
696
  msgstr ""
697
 
698
- #: admin/settings.php:334 blocks/blocks.php:84 includes/functions.php:285
699
  #: widgets/forms/categories.php:67
700
  msgid "Slug"
701
  msgstr ""
702
 
703
  #: admin/settings.php:340 admin/settings.php:419 blocks/blocks.php:85
704
- #: includes/functions.php:291 includes/functions.php:389
705
  #: widgets/forms/categories.php:78
706
  msgid "Order"
707
  msgstr ""
@@ -714,7 +689,7 @@ msgstr ""
714
  msgid "Descending"
715
  msgstr ""
716
 
717
- #: admin/settings.php:351 blocks/blocks.php:88 includes/functions.php:302
718
  #: widgets/forms/categories.php:95
719
  msgid "Show Hierarchy"
720
  msgstr ""
@@ -723,7 +698,7 @@ msgstr ""
723
  msgid "Check this to show the child categories"
724
  msgstr ""
725
 
726
- #: admin/settings.php:358 blocks/blocks.php:89 includes/functions.php:309
727
  #: widgets/forms/categories.php:100
728
  msgid "Show Description"
729
  msgstr ""
@@ -732,8 +707,8 @@ msgstr ""
732
  msgid "Check this to show the categories description"
733
  msgstr ""
734
 
735
- #: admin/settings.php:365 blocks/blocks.php:90 includes/functions.php:316
736
- #: includes/functions.php:447 widgets/forms/categories.php:105
737
  msgid "Show Videos Count"
738
  msgstr ""
739
 
@@ -741,7 +716,7 @@ msgstr ""
741
  msgid "Check this to show the videos count next to the category name"
742
  msgstr ""
743
 
744
- #: admin/settings.php:372 blocks/blocks.php:91 includes/functions.php:323
745
  #: widgets/forms/categories.php:110
746
  msgid "Hide Empty Categories"
747
  msgstr ""
@@ -750,7 +725,7 @@ msgstr ""
750
  msgid "Check this to hide categories with no videos"
751
  msgstr ""
752
 
753
- #: admin/settings.php:382 includes/functions.php:345
754
  #, php-format
755
  msgid ""
756
  "<a href=\"%s\" target=\"_blank\">Upgrade Pro</a> for more templates (Popup, "
@@ -761,7 +736,7 @@ msgstr ""
761
  msgid "Enter the number of columns you like to have in the gallery view."
762
  msgstr ""
763
 
764
- #: admin/settings.php:399 includes/functions.php:366
765
  msgid "Limit (per page)"
766
  msgstr ""
767
 
@@ -770,39 +745,39 @@ msgid ""
770
  "Number of videos to show per page. Use a value of \"0\" to show all videos."
771
  msgstr ""
772
 
773
- #: admin/settings.php:406 blocks/blocks.php:80 includes/functions.php:278
774
- #: includes/functions.php:376 widgets/forms/categories.php:60
775
  msgid "Order By"
776
  msgstr ""
777
 
778
- #: admin/settings.php:410 includes/functions.php:235 includes/functions.php:337
779
- #: includes/functions.php:380 widgets/forms/categories.php:15
780
  #: widgets/forms/search.php:15 widgets/forms/video.php:15
781
  msgid "Title"
782
  msgstr ""
783
 
784
- #: admin/settings.php:411 includes/functions.php:381
785
  msgid "Date Posted"
786
  msgstr ""
787
 
788
  #: admin/settings.php:412 admin/settings.php:449 admin/settings.php:473
789
- #: includes/functions.php:382
790
  msgid "Views Count"
791
  msgstr ""
792
 
793
- #: admin/settings.php:413 includes/functions.php:383
794
  msgid "Random"
795
  msgstr ""
796
 
797
- #: admin/settings.php:430 includes/functions.php:436
798
  msgid "Thumbnail Style"
799
  msgstr ""
800
 
801
- #: admin/settings.php:434 includes/functions.php:440
802
  msgid "Image Top Aligned"
803
  msgstr ""
804
 
805
- #: admin/settings.php:435 includes/functions.php:441
806
  msgid "Image Left Aligned"
807
  msgstr ""
808
 
@@ -834,7 +809,7 @@ msgstr ""
834
  msgid "Video Excerpt"
835
  msgstr ""
836
 
837
- #: admin/settings.php:457 includes/functions.php:496
838
  msgid "Excerpt Length"
839
  msgstr ""
840
 
@@ -842,7 +817,7 @@ msgstr ""
842
  msgid "Number of characters."
843
  msgstr ""
844
 
845
- #: admin/settings.php:474 includes/functions.php:407
846
  msgid "Related Videos"
847
  msgstr ""
848
 
@@ -868,7 +843,7 @@ msgstr ""
868
  msgid "Enable Services"
869
  msgstr ""
870
 
871
- #: admin/settings.php:503 includes/functions.php:1668
872
  msgid "Twitter"
873
  msgstr ""
874
 
@@ -876,7 +851,7 @@ msgstr ""
876
  msgid "Google Plus"
877
  msgstr ""
878
 
879
- #: admin/settings.php:505 includes/functions.php:1678
880
  msgid "Linkedin"
881
  msgstr ""
882
 
@@ -1168,17 +1143,17 @@ msgstr ""
1168
  msgid "Categories Settings"
1169
  msgstr ""
1170
 
1171
- #: blocks/blocks.php:75 includes/functions.php:253
1172
  #: widgets/forms/categories.php:20 widgets/forms/categories.php:23
1173
  msgid "Select Parent"
1174
  msgstr ""
1175
 
1176
- #: blocks/blocks.php:86 includes/functions.php:295 includes/functions.php:393
1177
  #: widgets/forms/categories.php:82
1178
  msgid "ASC"
1179
  msgstr ""
1180
 
1181
- #: blocks/blocks.php:87 includes/functions.php:296 includes/functions.php:394
1182
  #: widgets/forms/categories.php:83
1183
  msgid "DESC"
1184
  msgstr ""
@@ -1207,15 +1182,15 @@ msgstr ""
1207
  msgid "Search Form Settings"
1208
  msgstr ""
1209
 
1210
- #: blocks/blocks.php:98 includes/functions.php:638 widgets/forms/search.php:24
1211
  msgid "Vertical"
1212
  msgstr ""
1213
 
1214
- #: blocks/blocks.php:99 includes/functions.php:639 widgets/forms/search.php:25
1215
  msgid "Horizontal"
1216
  msgstr ""
1217
 
1218
- #: blocks/blocks.php:100 includes/functions.php:645 widgets/forms/search.php:37
1219
  msgid "Search By Categories"
1220
  msgstr ""
1221
 
@@ -1255,71 +1230,71 @@ msgstr ""
1255
  msgid "Remove Poster Image"
1256
  msgstr ""
1257
 
1258
- #: includes/functions.php:352
1259
  msgid "Select Categories"
1260
  msgstr ""
1261
 
1262
- #: includes/functions.php:359
1263
  msgid "Exclude Video ID(s)"
1264
  msgstr ""
1265
 
1266
- #: includes/functions.php:400
1267
  msgid "Featured Only"
1268
  msgstr ""
1269
 
1270
- #: includes/functions.php:407
1271
  msgid "Follow URL"
1272
  msgstr ""
1273
 
1274
- #: includes/functions.php:415
1275
  msgid "Gallery Settings"
1276
  msgstr ""
1277
 
1278
- #: includes/functions.php:454
1279
  msgid "Show Category Name"
1280
  msgstr ""
1281
 
1282
- #: includes/functions.php:461
1283
  msgid "Show Date Added"
1284
  msgstr ""
1285
 
1286
- #: includes/functions.php:468
1287
  msgid "Show Author Name"
1288
  msgstr ""
1289
 
1290
- #: includes/functions.php:475
1291
  msgid "Show Views Count"
1292
  msgstr ""
1293
 
1294
- #: includes/functions.php:482
1295
  msgid "Show Video Duration"
1296
  msgstr ""
1297
 
1298
- #: includes/functions.php:489
1299
  msgid "Show Video Excerpt"
1300
  msgstr ""
1301
 
1302
- #: includes/functions.php:503
1303
  msgid "Show Pagination"
1304
  msgstr ""
1305
 
1306
- #: includes/functions.php:510
1307
  msgid "Show More Button"
1308
  msgstr ""
1309
 
1310
- #: includes/functions.php:517
1311
  msgid "More Button Label"
1312
  msgstr ""
1313
 
1314
- #: includes/functions.php:520
1315
  msgid "Show More"
1316
  msgstr ""
1317
 
1318
- #: includes/functions.php:524
1319
  msgid "More Button Link"
1320
  msgstr ""
1321
 
1322
- #: includes/functions.php:538 widgets/forms/video.php:20
1323
  msgid "Select Video"
1324
  msgstr ""
1325
 
@@ -1337,56 +1312,56 @@ msgstr ""
1337
  msgid "No Items found."
1338
  msgstr ""
1339
 
1340
- #: includes/functions.php:1262
1341
  msgid "Self Hosted"
1342
  msgstr ""
1343
 
1344
- #: includes/functions.php:1262
1345
  msgid "External URL"
1346
  msgstr ""
1347
 
1348
- #: includes/functions.php:1267
1349
  msgid "Iframe Embed Code"
1350
  msgstr ""
1351
 
1352
- #: includes/functions.php:1281
1353
  msgid "Classic"
1354
  msgstr ""
1355
 
1356
- #: includes/functions.php:1412
1357
  msgid "Video Category"
1358
  msgstr ""
1359
 
1360
- #: includes/functions.php:1416 widgets/search.php:109
1361
  msgid "Search Videos"
1362
  msgstr ""
1363
 
1364
- #: includes/functions.php:1420
1365
  msgid "User Videos"
1366
  msgstr ""
1367
 
1368
- #: includes/functions.php:1424
1369
  msgid "Player Embed"
1370
  msgstr ""
1371
 
1372
- #: includes/functions.php:1594
1373
  msgid "&laquo;"
1374
  msgstr ""
1375
 
1376
- #: includes/functions.php:1595
1377
  msgid "&raquo;"
1378
  msgstr ""
1379
 
1380
- #: includes/functions.php:1610
1381
  #, php-format
1382
  msgid "Page %d of %d"
1383
  msgstr ""
1384
 
1385
- #: includes/functions.php:1673
1386
  msgid "Google+"
1387
  msgstr ""
1388
 
1389
- #: includes/functions.php:1683
1390
  msgid "Pin It"
1391
  msgstr ""
1392
 
@@ -1499,83 +1474,83 @@ msgstr ""
1499
  msgid "Popup"
1500
  msgstr ""
1501
 
1502
- #: premium/admin/slider.php:99
1503
  msgid "Slider"
1504
  msgstr ""
1505
 
1506
- #: premium/admin/slider.php:119 premium/admin/slider.php:256
1507
  msgid "Slider Layout"
1508
  msgstr ""
1509
 
1510
- #: premium/admin/slider.php:123 premium/admin/slider.php:260
1511
  msgid "Player Only"
1512
  msgstr ""
1513
 
1514
- #: premium/admin/slider.php:124 premium/admin/slider.php:261
1515
  msgid "Thumbnails Only"
1516
  msgstr ""
1517
 
1518
- #: premium/admin/slider.php:125 premium/admin/slider.php:262
1519
  msgid "Player + Thumbnails"
1520
  msgstr ""
1521
 
1522
- #: premium/admin/slider.php:137 premium/admin/slider.php:271
1523
  msgid "Arrows"
1524
  msgstr ""
1525
 
1526
- #: premium/admin/slider.php:144 premium/admin/slider.php:278
1527
  msgid "Arrow Size (in pixels)"
1528
  msgstr ""
1529
 
1530
- #: premium/admin/slider.php:154 premium/admin/slider.php:288
1531
  msgid "Arrow BG Color"
1532
  msgstr ""
1533
 
1534
- #: premium/admin/slider.php:161 premium/admin/slider.php:295
1535
  msgid "Arrow Icon Color"
1536
  msgstr ""
1537
 
1538
- #: premium/admin/slider.php:168 premium/admin/slider.php:302
1539
  msgid "Arrow Radius (in pixels)"
1540
  msgstr ""
1541
 
1542
- #: premium/admin/slider.php:178
1543
  msgid "Arrow Top Offset"
1544
  msgstr ""
1545
 
1546
- #: premium/admin/slider.php:188
1547
  msgid "Arrow Left Offset"
1548
  msgstr ""
1549
 
1550
- #: premium/admin/slider.php:198
1551
  msgid "Arrow Right Offset"
1552
  msgstr ""
1553
 
1554
- #: premium/admin/slider.php:208 premium/admin/slider.php:342
1555
  msgid "Dots"
1556
  msgstr ""
1557
 
1558
- #: premium/admin/slider.php:215
1559
  msgid "Dot Size (in pixels)"
1560
  msgstr ""
1561
 
1562
- #: premium/admin/slider.php:225 premium/admin/slider.php:359
1563
  msgid "Dot Color"
1564
  msgstr ""
1565
 
1566
- #: premium/admin/slider.php:312
1567
  msgid "Arrow Top Offset (in percentage)"
1568
  msgstr ""
1569
 
1570
- #: premium/admin/slider.php:322
1571
  msgid "Arrow Left Offset (in pixels)"
1572
  msgstr ""
1573
 
1574
- #: premium/admin/slider.php:332
1575
  msgid "Arrow Right Offset (in pixels)"
1576
  msgstr ""
1577
 
1578
- #: premium/admin/slider.php:349
1579
  msgid "Dot Size"
1580
  msgstr ""
1581
 
@@ -1624,10 +1599,6 @@ msgstr ""
1624
  msgid "%d videos"
1625
  msgstr ""
1626
 
1627
- #: public/templates/player.php:557
1628
- msgid "Please wait"
1629
- msgstr ""
1630
-
1631
  #: public/templates/search-form-template-horizontal.php:27
1632
  #: public/templates/search-form-template-vertical.php:27
1633
  msgid "Select a Category"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: All-in-One Video Gallery\n"
4
+ "POT-Creation-Date: 2019-03-05 21:45+0530\n"
5
+ "PO-Revision-Date: 2019-03-05 21:47+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: en_US\n"
113
  msgstr ""
114
 
115
  #: admin/categories.php:124 admin/settings.php:331 admin/videos.php:393
116
+ #: blocks/blocks.php:81 includes/functions.php:283
117
  #: widgets/forms/categories.php:64
118
  msgid "ID"
119
  msgstr ""
186
  msgstr ""
187
 
188
  #: admin/partials/video-sources.php:92 admin/partials/video-sources.php:95
189
+ #: admin/settings.php:279 includes/functions.php:1163
190
  msgid "YouTube"
191
  msgstr ""
192
 
195
  msgstr ""
196
 
197
  #: admin/partials/video-sources.php:103 admin/partials/video-sources.php:106
198
+ #: admin/settings.php:280 includes/functions.php:1164
199
  msgid "Vimeo"
200
  msgstr ""
201
 
204
  msgstr ""
205
 
206
  #: admin/partials/video-sources.php:114 admin/partials/video-sources.php:117
207
+ #: admin/settings.php:281 includes/functions.php:1165
208
  msgid "Dailymotion"
209
  msgstr ""
210
 
213
  msgstr ""
214
 
215
  #: admin/partials/video-sources.php:125 admin/partials/video-sources.php:128
216
+ #: admin/settings.php:282 admin/settings.php:502 includes/functions.php:1166
217
+ #: includes/functions.php:1555
218
  msgid "Facebook"
219
  msgstr ""
220
 
231
  msgstr ""
232
 
233
  #: admin/partials/video-sources.php:160 admin/partials/video-sources.php:163
234
+ #: admin/settings.php:266 blocks/blocks.php:121 includes/functions.php:600
235
  #: widgets/forms/video.php:84
236
  msgid "Duration"
237
  msgstr ""
294
 
295
  #: admin/partials/welcome.php:15
296
  #, php-format
297
+ msgid "All-in-One Video Gallery - %s"
298
  msgstr ""
299
 
300
  #: admin/partials/welcome.php:18
301
+ msgid "The last video player & gallery plugin you'll ever need."
302
  msgstr ""
303
 
304
+ #: admin/partials/welcome.php:23
305
+ msgid "Getting Started - Premium Features"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  msgstr ""
307
 
308
+ #: admin/partials/welcome.php:27
309
+ #, php-format
310
+ msgid "Version %s"
 
 
311
  msgstr ""
312
 
313
+ #: admin/partials/welcome.php:40 admin/partials/welcome.php:46
314
+ #: admin/partials/welcome.php:55 admin/partials/welcome.php:63
315
  #: admin/partials/welcome.php:76
316
+ #, php-format
317
+ msgid "Step #%d:"
318
  msgstr ""
319
 
320
+ #: admin/partials/welcome.php:42
321
+ msgid "Install & Activate <strong>All-in-One Video Gallery</strong>"
 
 
 
322
  msgstr ""
323
 
324
+ #: admin/partials/welcome.php:48 admin/partials/welcome.php:65
325
+ msgid "Optional"
326
  msgstr ""
327
 
328
+ #: admin/partials/welcome.php:50
329
+ msgid "Add Categories"
 
 
330
  msgstr ""
331
 
332
+ #: admin/partials/welcome.php:58
333
+ msgid "Add Videos"
334
  msgstr ""
335
 
336
+ #: admin/partials/welcome.php:68
337
+ #, php-format
338
  msgid ""
339
+ "Add a Categories <a href=\"%s\">Page</a> to your site front-end. Find step "
340
+ "by step instructions <a href=\"%s\" target=\"_blank\">here</a>"
 
341
  msgstr ""
342
 
343
+ #: admin/partials/welcome.php:80
344
+ #, php-format
345
+ msgid ""
346
+ "Add a Videos <a href=\"%s\">Page</a> to your site front-end. Find step by "
347
+ "step instructions <a href=\"%s\" target=\"_blank\">here</a>"
348
  msgstr ""
349
 
350
+ #: admin/partials/welcome.php:90
351
+ #, php-format
352
  msgid ""
353
+ "Please <a href=\"%s\" target=\"_blank\">refer</a> for more advanced "
354
+ "tutorials."
 
355
  msgstr ""
356
 
357
+ #: admin/partials/welcome.php:98
358
  msgid "Need Help?"
359
  msgstr ""
360
 
361
+ #: admin/partials/welcome.php:103
362
  msgid "Phenomenal Support"
363
  msgstr ""
364
 
365
+ #: admin/partials/welcome.php:106
366
  #, php-format
367
  msgid ""
368
  "We do our best to provide the best support we can. If you encounter a "
370
  "\"%s\" target=\"_blank\">support form</a>."
371
  msgstr ""
372
 
373
+ #: admin/partials/welcome.php:111
374
  msgid "Need Even Faster Support?"
375
  msgstr ""
376
 
377
+ #: admin/partials/welcome.php:114
378
  #, php-format
379
  msgid ""
380
  "Our <a href=\"%s\" target=\"_blank\">Priority Support</a> system is there "
393
  msgid "Advanced"
394
  msgstr ""
395
 
396
+ #: admin/settings.php:117 blocks/blocks.php:106 includes/functions.php:232
397
+ #: includes/functions.php:334 includes/functions.php:535
398
+ #: includes/functions.php:631
399
  msgid "General Settings"
400
  msgstr ""
401
 
467
  msgstr ""
468
 
469
  #: admin/settings.php:203 admin/settings.php:290 blocks/blocks.php:107
470
+ #: includes/functions.php:546 premium/widgets/forms/companion.php:15
471
  #: widgets/forms/video.php:46
472
  msgid "Width"
473
  msgstr ""
480
  msgstr ""
481
 
482
  #: admin/settings.php:210 admin/settings.php:297 blocks/blocks.php:109
483
+ #: includes/functions.php:262 includes/functions.php:420
484
+ #: includes/functions.php:553 widgets/forms/video.php:51
485
  msgid "Ratio"
486
  msgstr ""
487
 
519
  msgid "Cinemascope"
520
  msgstr ""
521
 
522
+ #: admin/settings.php:227 blocks/blocks.php:111 includes/functions.php:560
523
  #: widgets/forms/video.php:57
524
  msgid "Autoplay"
525
  msgstr ""
528
  msgid "Check this to start playing the video as soon as it is ready"
529
  msgstr ""
530
 
531
+ #: admin/settings.php:234 blocks/blocks.php:112 includes/functions.php:567
532
  #: widgets/forms/video.php:62
533
  msgid "Loop"
534
  msgstr ""
571
  msgid "None"
572
  msgstr ""
573
 
574
+ #: admin/settings.php:259 blocks/blocks.php:117 includes/functions.php:575
575
  #: widgets/forms/video.php:65
576
  msgid "Player Controls"
577
  msgstr ""
578
 
579
+ #: admin/settings.php:263 blocks/blocks.php:118 includes/functions.php:579
580
  #: widgets/forms/video.php:69
581
  msgid "Play / Pause"
582
  msgstr ""
583
 
584
+ #: admin/settings.php:264 blocks/blocks.php:119 includes/functions.php:586
585
  #: widgets/forms/video.php:74
586
  msgid "Current Time"
587
  msgstr ""
588
 
589
+ #: admin/settings.php:265 blocks/blocks.php:120 includes/functions.php:593
590
  #: widgets/forms/video.php:79
591
  msgid "Progressbar"
592
  msgstr ""
593
 
594
+ #: admin/settings.php:267 admin/videos.php:143 includes/functions.php:607
595
  #: widgets/forms/video.php:89
596
  msgid "Subtitles"
597
  msgstr ""
598
 
599
+ #: admin/settings.php:268 blocks/blocks.php:122 includes/functions.php:614
600
  #: widgets/forms/video.php:94
601
  msgid "Volume"
602
  msgstr ""
603
 
604
+ #: admin/settings.php:269 blocks/blocks.php:123 includes/functions.php:621
605
  #: widgets/forms/video.php:99
606
  msgid "Fullscreen"
607
  msgstr ""
630
  msgstr ""
631
 
632
  #: admin/settings.php:306 admin/settings.php:381 blocks/blocks.php:76
633
+ #: includes/functions.php:243 includes/functions.php:345
634
+ #: includes/functions.php:635 widgets/forms/categories.php:39
635
  #: widgets/forms/search.php:20
636
  msgid "Select Template"
637
  msgstr ""
638
 
639
+ #: admin/settings.php:310 blocks/blocks.php:77 includes/functions.php:247
640
  #: widgets/forms/categories.php:43
641
  msgid "Grid"
642
  msgstr ""
643
 
644
+ #: admin/settings.php:311 blocks/blocks.php:78 includes/functions.php:248
645
  #: widgets/forms/categories.php:44
646
  msgid "List"
647
  msgstr ""
648
 
649
  #: admin/settings.php:317 admin/settings.php:389 blocks/blocks.php:79
650
+ #: includes/functions.php:269 includes/functions.php:427
651
  #: widgets/forms/categories.php:55
652
  msgid "Columns"
653
  msgstr ""
660
  msgid "Order by"
661
  msgstr ""
662
 
663
+ #: admin/settings.php:332 blocks/blocks.php:82 includes/functions.php:284
664
  #: widgets/forms/categories.php:65
665
  msgid "Count"
666
  msgstr ""
667
 
668
+ #: admin/settings.php:333 blocks/blocks.php:83 includes/functions.php:285
669
  #: widgets/forms/categories.php:66
670
  msgid "Name"
671
  msgstr ""
672
 
673
+ #: admin/settings.php:334 blocks/blocks.php:84 includes/functions.php:286
674
  #: widgets/forms/categories.php:67
675
  msgid "Slug"
676
  msgstr ""
677
 
678
  #: admin/settings.php:340 admin/settings.php:419 blocks/blocks.php:85
679
+ #: includes/functions.php:292 includes/functions.php:390
680
  #: widgets/forms/categories.php:78
681
  msgid "Order"
682
  msgstr ""
689
  msgid "Descending"
690
  msgstr ""
691
 
692
+ #: admin/settings.php:351 blocks/blocks.php:88 includes/functions.php:303
693
  #: widgets/forms/categories.php:95
694
  msgid "Show Hierarchy"
695
  msgstr ""
698
  msgid "Check this to show the child categories"
699
  msgstr ""
700
 
701
+ #: admin/settings.php:358 blocks/blocks.php:89 includes/functions.php:310
702
  #: widgets/forms/categories.php:100
703
  msgid "Show Description"
704
  msgstr ""
707
  msgid "Check this to show the categories description"
708
  msgstr ""
709
 
710
+ #: admin/settings.php:365 blocks/blocks.php:90 includes/functions.php:317
711
+ #: includes/functions.php:448 widgets/forms/categories.php:105
712
  msgid "Show Videos Count"
713
  msgstr ""
714
 
716
  msgid "Check this to show the videos count next to the category name"
717
  msgstr ""
718
 
719
+ #: admin/settings.php:372 blocks/blocks.php:91 includes/functions.php:324
720
  #: widgets/forms/categories.php:110
721
  msgid "Hide Empty Categories"
722
  msgstr ""
725
  msgid "Check this to hide categories with no videos"
726
  msgstr ""
727
 
728
+ #: admin/settings.php:382 includes/functions.php:346
729
  #, php-format
730
  msgid ""
731
  "<a href=\"%s\" target=\"_blank\">Upgrade Pro</a> for more templates (Popup, "
736
  msgid "Enter the number of columns you like to have in the gallery view."
737
  msgstr ""
738
 
739
+ #: admin/settings.php:399 includes/functions.php:367
740
  msgid "Limit (per page)"
741
  msgstr ""
742
 
745
  "Number of videos to show per page. Use a value of \"0\" to show all videos."
746
  msgstr ""
747
 
748
+ #: admin/settings.php:406 blocks/blocks.php:80 includes/functions.php:279
749
+ #: includes/functions.php:377 widgets/forms/categories.php:60
750
  msgid "Order By"
751
  msgstr ""
752
 
753
+ #: admin/settings.php:410 includes/functions.php:236 includes/functions.php:338
754
+ #: includes/functions.php:381 widgets/forms/categories.php:15
755
  #: widgets/forms/search.php:15 widgets/forms/video.php:15
756
  msgid "Title"
757
  msgstr ""
758
 
759
+ #: admin/settings.php:411 includes/functions.php:382
760
  msgid "Date Posted"
761
  msgstr ""
762
 
763
  #: admin/settings.php:412 admin/settings.php:449 admin/settings.php:473
764
+ #: includes/functions.php:383
765
  msgid "Views Count"
766
  msgstr ""
767
 
768
+ #: admin/settings.php:413 includes/functions.php:384
769
  msgid "Random"
770
  msgstr ""
771
 
772
+ #: admin/settings.php:430 includes/functions.php:437
773
  msgid "Thumbnail Style"
774
  msgstr ""
775
 
776
+ #: admin/settings.php:434 includes/functions.php:441
777
  msgid "Image Top Aligned"
778
  msgstr ""
779
 
780
+ #: admin/settings.php:435 includes/functions.php:442
781
  msgid "Image Left Aligned"
782
  msgstr ""
783
 
809
  msgid "Video Excerpt"
810
  msgstr ""
811
 
812
+ #: admin/settings.php:457 includes/functions.php:497
813
  msgid "Excerpt Length"
814
  msgstr ""
815
 
817
  msgid "Number of characters."
818
  msgstr ""
819
 
820
+ #: admin/settings.php:474 includes/functions.php:408
821
  msgid "Related Videos"
822
  msgstr ""
823
 
843
  msgid "Enable Services"
844
  msgstr ""
845
 
846
+ #: admin/settings.php:503 includes/functions.php:1560
847
  msgid "Twitter"
848
  msgstr ""
849
 
851
  msgid "Google Plus"
852
  msgstr ""
853
 
854
+ #: admin/settings.php:505 includes/functions.php:1570
855
  msgid "Linkedin"
856
  msgstr ""
857
 
1143
  msgid "Categories Settings"
1144
  msgstr ""
1145
 
1146
+ #: blocks/blocks.php:75 includes/functions.php:254
1147
  #: widgets/forms/categories.php:20 widgets/forms/categories.php:23
1148
  msgid "Select Parent"
1149
  msgstr ""
1150
 
1151
+ #: blocks/blocks.php:86 includes/functions.php:296 includes/functions.php:394
1152
  #: widgets/forms/categories.php:82
1153
  msgid "ASC"
1154
  msgstr ""
1155
 
1156
+ #: blocks/blocks.php:87 includes/functions.php:297 includes/functions.php:395
1157
  #: widgets/forms/categories.php:83
1158
  msgid "DESC"
1159
  msgstr ""
1182
  msgid "Search Form Settings"
1183
  msgstr ""
1184
 
1185
+ #: blocks/blocks.php:98 includes/functions.php:639 widgets/forms/search.php:24
1186
  msgid "Vertical"
1187
  msgstr ""
1188
 
1189
+ #: blocks/blocks.php:99 includes/functions.php:640 widgets/forms/search.php:25
1190
  msgid "Horizontal"
1191
  msgstr ""
1192
 
1193
+ #: blocks/blocks.php:100 includes/functions.php:646 widgets/forms/search.php:37
1194
  msgid "Search By Categories"
1195
  msgstr ""
1196
 
1230
  msgid "Remove Poster Image"
1231
  msgstr ""
1232
 
1233
+ #: includes/functions.php:353
1234
  msgid "Select Categories"
1235
  msgstr ""
1236
 
1237
+ #: includes/functions.php:360
1238
  msgid "Exclude Video ID(s)"
1239
  msgstr ""
1240
 
1241
+ #: includes/functions.php:401
1242
  msgid "Featured Only"
1243
  msgstr ""
1244
 
1245
+ #: includes/functions.php:408
1246
  msgid "Follow URL"
1247
  msgstr ""
1248
 
1249
+ #: includes/functions.php:416
1250
  msgid "Gallery Settings"
1251
  msgstr ""
1252
 
1253
+ #: includes/functions.php:455
1254
  msgid "Show Category Name"
1255
  msgstr ""
1256
 
1257
+ #: includes/functions.php:462
1258
  msgid "Show Date Added"
1259
  msgstr ""
1260
 
1261
+ #: includes/functions.php:469
1262
  msgid "Show Author Name"
1263
  msgstr ""
1264
 
1265
+ #: includes/functions.php:476
1266
  msgid "Show Views Count"
1267
  msgstr ""
1268
 
1269
+ #: includes/functions.php:483
1270
  msgid "Show Video Duration"
1271
  msgstr ""
1272
 
1273
+ #: includes/functions.php:490
1274
  msgid "Show Video Excerpt"
1275
  msgstr ""
1276
 
1277
+ #: includes/functions.php:504
1278
  msgid "Show Pagination"
1279
  msgstr ""
1280
 
1281
+ #: includes/functions.php:511
1282
  msgid "Show More Button"
1283
  msgstr ""
1284
 
1285
+ #: includes/functions.php:518
1286
  msgid "More Button Label"
1287
  msgstr ""
1288
 
1289
+ #: includes/functions.php:521
1290
  msgid "Show More"
1291
  msgstr ""
1292
 
1293
+ #: includes/functions.php:525
1294
  msgid "More Button Link"
1295
  msgstr ""
1296
 
1297
+ #: includes/functions.php:539 widgets/forms/video.php:20
1298
  msgid "Select Video"
1299
  msgstr ""
1300
 
1312
  msgid "No Items found."
1313
  msgstr ""
1314
 
1315
+ #: includes/functions.php:1162
1316
  msgid "Self Hosted"
1317
  msgstr ""
1318
 
1319
+ #: includes/functions.php:1162
1320
  msgid "External URL"
1321
  msgstr ""
1322
 
1323
+ #: includes/functions.php:1167
1324
  msgid "Iframe Embed Code"
1325
  msgstr ""
1326
 
1327
+ #: includes/functions.php:1181
1328
  msgid "Classic"
1329
  msgstr ""
1330
 
1331
+ #: includes/functions.php:1311
1332
  msgid "Video Category"
1333
  msgstr ""
1334
 
1335
+ #: includes/functions.php:1315 widgets/search.php:109
1336
  msgid "Search Videos"
1337
  msgstr ""
1338
 
1339
+ #: includes/functions.php:1319
1340
  msgid "User Videos"
1341
  msgstr ""
1342
 
1343
+ #: includes/functions.php:1323
1344
  msgid "Player Embed"
1345
  msgstr ""
1346
 
1347
+ #: includes/functions.php:1494
1348
  msgid "&laquo;"
1349
  msgstr ""
1350
 
1351
+ #: includes/functions.php:1495
1352
  msgid "&raquo;"
1353
  msgstr ""
1354
 
1355
+ #: includes/functions.php:1510
1356
  #, php-format
1357
  msgid "Page %d of %d"
1358
  msgstr ""
1359
 
1360
+ #: includes/functions.php:1565
1361
  msgid "Google+"
1362
  msgstr ""
1363
 
1364
+ #: includes/functions.php:1575
1365
  msgid "Pin It"
1366
  msgstr ""
1367
 
1474
  msgid "Popup"
1475
  msgstr ""
1476
 
1477
+ #: premium/admin/slider.php:84
1478
  msgid "Slider"
1479
  msgstr ""
1480
 
1481
+ #: premium/admin/slider.php:104 premium/admin/slider.php:237
1482
  msgid "Slider Layout"
1483
  msgstr ""
1484
 
1485
+ #: premium/admin/slider.php:108 premium/admin/slider.php:241
1486
  msgid "Player Only"
1487
  msgstr ""
1488
 
1489
+ #: premium/admin/slider.php:109 premium/admin/slider.php:242
1490
  msgid "Thumbnails Only"
1491
  msgstr ""
1492
 
1493
+ #: premium/admin/slider.php:110 premium/admin/slider.php:243
1494
  msgid "Player + Thumbnails"
1495
  msgstr ""
1496
 
1497
+ #: premium/admin/slider.php:122 premium/admin/slider.php:252
1498
  msgid "Arrows"
1499
  msgstr ""
1500
 
1501
+ #: premium/admin/slider.php:129 premium/admin/slider.php:259
1502
  msgid "Arrow Size (in pixels)"
1503
  msgstr ""
1504
 
1505
+ #: premium/admin/slider.php:139 premium/admin/slider.php:269
1506
  msgid "Arrow BG Color"
1507
  msgstr ""
1508
 
1509
+ #: premium/admin/slider.php:146 premium/admin/slider.php:276
1510
  msgid "Arrow Icon Color"
1511
  msgstr ""
1512
 
1513
+ #: premium/admin/slider.php:153 premium/admin/slider.php:283
1514
  msgid "Arrow Radius (in pixels)"
1515
  msgstr ""
1516
 
1517
+ #: premium/admin/slider.php:163
1518
  msgid "Arrow Top Offset"
1519
  msgstr ""
1520
 
1521
+ #: premium/admin/slider.php:173
1522
  msgid "Arrow Left Offset"
1523
  msgstr ""
1524
 
1525
+ #: premium/admin/slider.php:183
1526
  msgid "Arrow Right Offset"
1527
  msgstr ""
1528
 
1529
+ #: premium/admin/slider.php:193 premium/admin/slider.php:323
1530
  msgid "Dots"
1531
  msgstr ""
1532
 
1533
+ #: premium/admin/slider.php:200
1534
  msgid "Dot Size (in pixels)"
1535
  msgstr ""
1536
 
1537
+ #: premium/admin/slider.php:210 premium/admin/slider.php:340
1538
  msgid "Dot Color"
1539
  msgstr ""
1540
 
1541
+ #: premium/admin/slider.php:293
1542
  msgid "Arrow Top Offset (in percentage)"
1543
  msgstr ""
1544
 
1545
+ #: premium/admin/slider.php:303
1546
  msgid "Arrow Left Offset (in pixels)"
1547
  msgstr ""
1548
 
1549
+ #: premium/admin/slider.php:313
1550
  msgid "Arrow Right Offset (in pixels)"
1551
  msgstr ""
1552
 
1553
+ #: premium/admin/slider.php:330
1554
  msgid "Dot Size"
1555
  msgstr ""
1556
 
1599
  msgid "%d videos"
1600
  msgstr ""
1601
 
 
 
 
 
1602
  #: public/templates/search-form-template-horizontal.php:27
1603
  #: public/templates/search-form-template-vertical.php:27
1604
  msgid "Select a Category"
public/assets/css/backward-compatibility.css CHANGED
@@ -119,5 +119,9 @@
119
 
120
  .aiovg .col-md-6 {
121
  width: 50%;
122
- }
 
 
 
 
123
  }
119
 
120
  .aiovg .col-md-6 {
121
  width: 50%;
122
+ }
123
+
124
+ .aiovg .col-md-8 {
125
+ width: 66.66%;
126
+ }
127
  }
public/assets/css/public.css CHANGED
@@ -409,52 +409,6 @@
409
  background: #9e0718;
410
  }
411
 
412
- /*----------------------------------------------------------------------------------------------
413
- *
414
- * GDPR
415
- *
416
- *--------------------------------------------------------------------------------------------*/
417
- .aiovg-privacy-wrapper {
418
- position: absolute;
419
- width: 100%;
420
- height: 100%;
421
- top: 0;
422
- left: 0;
423
- background-color: #222;
424
- background-size: cover;
425
- background-position: center;
426
- background-repeat: no-repeat;
427
- color: #FFF;
428
- text-align: center;
429
- z-index: 9;
430
- }
431
-
432
- .aiovg-privacy-consent-block {
433
- position: relative;
434
- margin: 15px;
435
- padding: 15px;
436
- top: 50%;
437
- background: #000;
438
- border-radius: 3px;
439
- opacity: 0.9;
440
- transform: translateY( -50% );
441
- -ms-transform: translateY(- 50% );
442
- -webkit-transform: translateY( -50% );
443
- }
444
-
445
- .aiovg-privacy-consent-button {
446
- display: inline-block;
447
- margin-top: 10px;
448
- padding: 5px 15px;
449
- background: #F00;
450
- border-radius: 3px;
451
- cursor: pointer;
452
- }
453
-
454
- .aiovg-privacy-consent-button:hover {
455
- opacity: 0.8;
456
- }
457
-
458
  /*----------------------------------------------------------------------------------------------
459
  *
460
  * Third-party theme conflicts
409
  background: #9e0718;
410
  }
411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  /*----------------------------------------------------------------------------------------------
413
  *
414
  * Third-party theme conflicts
public/assets/js/public.js CHANGED
@@ -1,20 +1,5 @@
1
  (function( $ ) {
2
  'use strict';
3
-
4
- /**
5
- * Set cookie for accepting the privacy consent.
6
- *
7
- * @since 1.0.0
8
- */
9
- function aiovg_set_cookie() {
10
- var data = {
11
- 'action': 'aiovg_set_cookie'
12
- };
13
-
14
- $.post( aiovg.ajax_url, data, function( response ) {
15
- // console.log( 'Cookie stored!' );
16
- });
17
- }
18
 
19
  /**
20
  * Called when the page has loaded.
@@ -22,18 +7,6 @@
22
  * @since 1.0.0
23
  */
24
  $(function() {
25
-
26
- $( '.aiovg-privacy-consent-button' ).on( 'click', function() {
27
- aiovg_set_cookie();
28
-
29
- var container = $( this ).closest( '.aiovg-player' );
30
-
31
- var iframe = container.find( 'iframe' ).clone();
32
- var src = iframe.data( 'src' );
33
- iframe.attr( 'src', src );
34
-
35
- container.html( iframe );
36
- });
37
 
38
  });
39
 
1
  (function( $ ) {
2
  'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  /**
5
  * Called when the page has loaded.
7
  * @since 1.0.0
8
  */
9
  $(function() {
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  });
12
 
public/assets/mediaelement/renderers/vimeo.js CHANGED
@@ -370,6 +370,7 @@ var vimeoIframeRenderer = {
370
  vimeoContainer.setAttribute('webkitallowfullscreen', 'true');
371
  vimeoContainer.setAttribute('mozallowfullscreen', 'true');
372
  vimeoContainer.setAttribute('allowfullscreen', 'true');
 
373
 
374
  mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode);
375
  mediaElement.originalNode.style.display = 'none';
370
  vimeoContainer.setAttribute('webkitallowfullscreen', 'true');
371
  vimeoContainer.setAttribute('mozallowfullscreen', 'true');
372
  vimeoContainer.setAttribute('allowfullscreen', 'true');
373
+ vimeoContainer.setAttribute('allow', 'autoplay');
374
 
375
  mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode);
376
  mediaElement.originalNode.style.display = 'none';
public/assets/mediaelement/renderers/vimeo.min.js CHANGED
@@ -9,4 +9,4 @@
9
  * License: MIT
10
  *
11
  */
12
- !function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r={promise:null,load:function(e){"undefined"!=typeof Vimeo?r._createPlayer(e):(r.promise=r.promise||mejs.Utils.loadScript("https://player.vimeo.com/api/player.js"),r.promise.then(function(){r._createPlayer(e)}))},_createPlayer:function(e){var t=new Vimeo.Player(e.iframe);window["__ready__"+e.id](t)},getVimeoId:function(e){return void 0===e||null===e?null:(e=e.split("?")[0],parseInt(e.substring(e.lastIndexOf("/")+1),10))}},i={name:"vimeo_iframe",options:{prefix:"vimeo_iframe"},canPlayType:function(e){return~["video/vimeo","video/x-vimeo"].indexOf(e.toLowerCase())},create:function(e,t,n){var i=[],a={},o=!0,s=1,u=s,c=0,l=0,d=!1,f=0,p=null,m="";a.options=t,a.id=e.id+"_"+t.prefix,a.mediaElement=e;for(var v=function(t){e.generateError("Code "+t.name+": "+t.message,n)},h=mejs.html5media.properties,y=0,g=h.length;y<g;y++)!function(t){var n=""+t.substring(0,1).toUpperCase()+t.substring(1);a["get"+n]=function(){if(null!==p){switch(t){case"currentTime":return c;case"duration":return f;case"volume":return s;case"muted":return 0===s;case"paused":return o;case"ended":return d;case"src":return p.getVideoUrl().then(function(e){m=e}).catch(function(e){return v(e)}),m;case"buffered":return{start:function(){return 0},end:function(){return l*f},length:1};case"readyState":return 4}return null}return null},a["set"+n]=function(n){if(null!==p)switch(t){case"src":var o="string"==typeof n?n:n[0].src,l=r.getVimeoId(o);p.loadVideo(l).then(function(){e.originalNode.autoplay&&p.play()}).catch(function(e){return v(e)});break;case"currentTime":p.setCurrentTime(n).then(function(){c=n,setTimeout(function(){var t=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"volume":p.setVolume(n).then(function(){u=s=n,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"loop":p.setLoop(n).catch(function(e){return v(e)});break;case"muted":n?p.setVolume(0).then(function(){s=0,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)}):p.setVolume(u).then(function(){s=u,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"readyState":var d=mejs.Utils.createEvent("canplay",a);e.dispatchEvent(d)}else i.push({type:"set",propName:t,value:n})}}(h[y]);for(var E=mejs.html5media.methods,U=0,b=E.length;U<b;U++)!function(e){a[e]=function(){if(null!==p)switch(e){case"play":return o=!1,p.play();case"pause":return o=!0,p.pause();case"load":return null}else i.push({type:"call",methodName:e})}}(E[U]);window["__ready__"+a.id]=function(t){if(e.vimeoPlayer=p=t,i.length)for(var n=0,r=i.length;n<r;n++){var u=i[n];if("set"===u.type){var m=u.propName,h=""+m.substring(0,1).toUpperCase()+m.substring(1);a["set"+h](u.value)}else"call"===u.type&&a[u.methodName]()}e.originalNode.muted&&(p.setVolume(0),s=0);for(var y=document.getElementById(a.id),g=void 0,E=0,U=(g=["mouseover","mouseout"]).length;E<U;E++)y.addEventListener(g[E],function(t){var n=mejs.Utils.createEvent(t.type,a);e.dispatchEvent(n)},!1);p.on("loaded",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){o=!1,d=!1;var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n)}}).catch(function(e){v(e)})}),p.on("progress",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n);var r=mejs.Utils.createEvent("playing",a);e.dispatchEvent(r)}var i=mejs.Utils.createEvent("progress",a);e.dispatchEvent(i)}).catch(function(e){return v(e)})}),p.on("timeupdate",function(){p.getCurrentTime().then(function(t){c=t;var n=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(n)}).catch(function(e){return v(e)})}),p.on("play",function(){o=!1,d=!1;var t=mejs.Utils.createEvent("play",a);e.dispatchEvent(t);var n=mejs.Utils.createEvent("playing",a);e.dispatchEvent(n)}),p.on("pause",function(){o=!0,d=!1;var t=mejs.Utils.createEvent("pause",a);e.dispatchEvent(t)}),p.on("ended",function(){o=!1,d=!0;var t=mejs.Utils.createEvent("ended",a);e.dispatchEvent(t)});for(var b=0,j=(g=["rendererready","loadedmetadata","loadeddata","canplay"]).length;b<j;b++){var w=mejs.Utils.createEvent(g[b],a);e.dispatchEvent(w)}};var j=e.originalNode.height,w=e.originalNode.width,N=document.createElement("iframe"),_="https://player.vimeo.com/video/"+r.getVimeoId(n[0].src),x=~n[0].src.indexOf("?")?"?"+n[0].src.slice(n[0].src.indexOf("?")+1):"";return x&&e.originalNode.autoplay&&-1===x.indexOf("autoplay")&&(x+="&autoplay=1"),x&&e.originalNode.loop&&-1===x.indexOf("loop")&&(x+="&loop=1"),N.setAttribute("id",a.id),N.setAttribute("width",w),N.setAttribute("height",j),N.setAttribute("frameBorder","0"),N.setAttribute("src",""+_+x),N.setAttribute("webkitallowfullscreen","true"),N.setAttribute("mozallowfullscreen","true"),N.setAttribute("allowfullscreen","true"),e.originalNode.parentNode.insertBefore(N,e.originalNode),e.originalNode.style.display="none",r.load({iframe:N,id:a.id}),a.hide=function(){a.pause(),p&&(N.style.display="none")},a.setSize=function(e,t){N.setAttribute("width",e),N.setAttribute("height",t)},a.show=function(){p&&(N.style.display="")},a.destroy=function(){},a}};mejs.Utils.typeChecks.push(function(e){return/(\/\/player\.vimeo|vimeo\.com)/i.test(e)?"video/x-vimeo":null}),mejs.Renderers.add(i)},{}]},{},[1]);
9
  * License: MIT
10
  *
11
  */
12
+ !function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r={promise:null,load:function(e){"undefined"!=typeof Vimeo?r._createPlayer(e):(r.promise=r.promise||mejs.Utils.loadScript("https://player.vimeo.com/api/player.js"),r.promise.then(function(){r._createPlayer(e)}))},_createPlayer:function(e){var t=new Vimeo.Player(e.iframe);window["__ready__"+e.id](t)},getVimeoId:function(e){return void 0===e||null===e?null:(e=e.split("?")[0],parseInt(e.substring(e.lastIndexOf("/")+1),10))}},i={name:"vimeo_iframe",options:{prefix:"vimeo_iframe"},canPlayType:function(e){return~["video/vimeo","video/x-vimeo"].indexOf(e.toLowerCase())},create:function(e,t,n){var i=[],a={},o=!0,s=1,u=s,c=0,l=0,d=!1,f=0,p=null,m="";a.options=t,a.id=e.id+"_"+t.prefix,a.mediaElement=e;for(var v=function(t){e.generateError("Code "+t.name+": "+t.message,n)},h=mejs.html5media.properties,y=0,g=h.length;y<g;y++)!function(t){var n=""+t.substring(0,1).toUpperCase()+t.substring(1);a["get"+n]=function(){if(null!==p){switch(t){case"currentTime":return c;case"duration":return f;case"volume":return s;case"muted":return 0===s;case"paused":return o;case"ended":return d;case"src":return p.getVideoUrl().then(function(e){m=e}).catch(function(e){return v(e)}),m;case"buffered":return{start:function(){return 0},end:function(){return l*f},length:1};case"readyState":return 4}return null}return null},a["set"+n]=function(n){if(null!==p)switch(t){case"src":var o="string"==typeof n?n:n[0].src,l=r.getVimeoId(o);p.loadVideo(l).then(function(){e.originalNode.autoplay&&p.play()}).catch(function(e){return v(e)});break;case"currentTime":p.setCurrentTime(n).then(function(){c=n,setTimeout(function(){var t=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"volume":p.setVolume(n).then(function(){u=s=n,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"loop":p.setLoop(n).catch(function(e){return v(e)});break;case"muted":n?p.setVolume(0).then(function(){s=0,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)}):p.setVolume(u).then(function(){s=u,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"readyState":var d=mejs.Utils.createEvent("canplay",a);e.dispatchEvent(d)}else i.push({type:"set",propName:t,value:n})}}(h[y]);for(var E=mejs.html5media.methods,U=0,b=E.length;U<b;U++)!function(e){a[e]=function(){if(null!==p)switch(e){case"play":return o=!1,p.play();case"pause":return o=!0,p.pause();case"load":return null}else i.push({type:"call",methodName:e})}}(E[U]);window["__ready__"+a.id]=function(t){if(e.vimeoPlayer=p=t,i.length)for(var n=0,r=i.length;n<r;n++){var u=i[n];if("set"===u.type){var m=u.propName,h=""+m.substring(0,1).toUpperCase()+m.substring(1);a["set"+h](u.value)}else"call"===u.type&&a[u.methodName]()}e.originalNode.muted&&(p.setVolume(0),s=0);for(var y=document.getElementById(a.id),g=void 0,E=0,U=(g=["mouseover","mouseout"]).length;E<U;E++)y.addEventListener(g[E],function(t){var n=mejs.Utils.createEvent(t.type,a);e.dispatchEvent(n)},!1);p.on("loaded",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){o=!1,d=!1;var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n)}}).catch(function(e){v(e)})}),p.on("progress",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n);var r=mejs.Utils.createEvent("playing",a);e.dispatchEvent(r)}var i=mejs.Utils.createEvent("progress",a);e.dispatchEvent(i)}).catch(function(e){return v(e)})}),p.on("timeupdate",function(){p.getCurrentTime().then(function(t){c=t;var n=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(n)}).catch(function(e){return v(e)})}),p.on("play",function(){o=!1,d=!1;var t=mejs.Utils.createEvent("play",a);e.dispatchEvent(t);var n=mejs.Utils.createEvent("playing",a);e.dispatchEvent(n)}),p.on("pause",function(){o=!0,d=!1;var t=mejs.Utils.createEvent("pause",a);e.dispatchEvent(t)}),p.on("ended",function(){o=!1,d=!0;var t=mejs.Utils.createEvent("ended",a);e.dispatchEvent(t)});for(var b=0,j=(g=["rendererready","loadedmetadata","loadeddata","canplay"]).length;b<j;b++){var w=mejs.Utils.createEvent(g[b],a);e.dispatchEvent(w)}};var j=e.originalNode.height,w=e.originalNode.width,N=document.createElement("iframe"),_="https://player.vimeo.com/video/"+r.getVimeoId(n[0].src),x=~n[0].src.indexOf("?")?"?"+n[0].src.slice(n[0].src.indexOf("?")+1):"";return x&&e.originalNode.autoplay&&-1===x.indexOf("autoplay")&&(x+="&autoplay=1"),x&&e.originalNode.loop&&-1===x.indexOf("loop")&&(x+="&loop=1"),N.setAttribute("id",a.id),N.setAttribute("width",w),N.setAttribute("height",j),N.setAttribute("frameBorder","0"),N.setAttribute("src",""+_+x),N.setAttribute("webkitallowfullscreen","true"),N.setAttribute("mozallowfullscreen","true"),N.setAttribute("allowfullscreen","true"),N.setAttribute("allow","autoplay"),e.originalNode.parentNode.insertBefore(N,e.originalNode),e.originalNode.style.display="none",r.load({iframe:N,id:a.id}),a.hide=function(){a.pause(),p&&(N.style.display="none")},a.setSize=function(e,t){N.setAttribute("width",e),N.setAttribute("height",t)},a.show=function(){p&&(N.style.display="")},a.destroy=function(){},a}};mejs.Utils.typeChecks.push(function(e){return/(\/\/player\.vimeo|vimeo\.com)/i.test(e)?"video/x-vimeo":null}),mejs.Renderers.add(i)},{}]},{},[1]);
public/templates/player-gdpr.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Video Player - GDPR Consent.
5
+ *
6
+ * @link https://plugins360.com
7
+ * @since 1.6.0
8
+ *
9
+ * @package All_In_One_Video_Gallery
10
+ */
11
+
12
+ $image = '';
13
+
14
+ if ( isset( $_GET['poster'] ) ) {
15
+ $image = $_GET['poster'];
16
+ } elseif ( ! empty( $post_meta ) ) {
17
+ $image = aiovg_get_image_url( $post_meta['image_id'][0], 'large', $post_meta['image'][0], 'player' );
18
+ }
19
+
20
+ if ( empty( $image ) ) {
21
+ foreach ( $embedded_sources as $source ) {
22
+ $is_src_found = 0;
23
+
24
+ if ( isset( $_GET[ $source ] ) ) {
25
+ $is_src_found = 1;
26
+ $src = urldecode( $_GET[ $source ] );
27
+ }
28
+
29
+ if ( $is_src_found ) {
30
+ switch ( $source ) {
31
+ case 'youtube':
32
+ $src = aiovg_get_youtube_image_url( $src );
33
+ break;
34
+ case 'vimeo':
35
+ $src = aiovg_get_vimeo_image_url( $src );
36
+ break;
37
+ case 'dailymotion':
38
+ $src = aiovg_get_dailymotion_image_url( $src );
39
+ break;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ?>
45
+ <!DOCTYPE html>
46
+ <html>
47
+ <head>
48
+ <meta charset="utf-8">
49
+ <meta name="viewport" content="width=device-width, initial-scale=1">
50
+ <?php if ( $post_id > 0 ) : ?>
51
+ <title><?php echo wp_kses_post( get_the_title( $post_id ) ); ?></title>
52
+ <link rel="canonical" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
53
+ <meta property="og:url" content="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
54
+ <?php endif; ?>
55
+
56
+ <style type="text/css">
57
+ html,
58
+ body {
59
+ width: 100% !important;
60
+ height: 100% !important;
61
+ margin: 0 !important;
62
+ padding: 0 !important;
63
+ font-family: Verdana, Geneva, sans-serif;
64
+ font-size: 14px;
65
+ line-height: 1.5;
66
+ overflow: hidden;
67
+ }
68
+
69
+ #privacy-wrapper {
70
+ width: 100%;
71
+ height: 100%;
72
+ margin: 0;
73
+ padding: 0;
74
+ background-color: #222;
75
+ background-size: cover;
76
+ background-position: center;
77
+ background-repeat: no-repeat;
78
+ color: #FFF;
79
+ text-align: center;
80
+ }
81
+
82
+ #privacy-consent-block {
83
+ position: relative;
84
+ margin: 0 30px;
85
+ padding: 15px;
86
+ top: 50%;
87
+ background: #000;
88
+ border-radius: 3px;
89
+ opacity: 0.9;
90
+ transform: translateY( -50% );
91
+ -ms-transform: translateY(- 50% );
92
+ -webkit-transform: translateY( -50% );
93
+ }
94
+
95
+ #privacy-consent-button {
96
+ display: inline-block;
97
+ margin-top: 10px;
98
+ padding: 5px 15px;
99
+ background: #F00;
100
+ border-radius: 3px;
101
+ cursor: pointer;
102
+ }
103
+
104
+ #privacy-consent-button:hover {
105
+ opacity: 0.8;
106
+ }
107
+
108
+ @media only screen and (max-width: 250px) {
109
+ #privacy-consent-block {
110
+ margin: 0;
111
+ font-size: 12px;
112
+ }
113
+ }
114
+ </style>
115
+ </head>
116
+ <body>
117
+ <div id="privacy-wrapper" style="background-image: url(<?php echo esc_url_raw( $image ); ?>);">
118
+ <div id="privacy-consent-block" >
119
+ <div id="privacy-consent-message"><?php echo wp_kses_post( trim( $privacy_settings['consent_message'] ) ); ?></div>
120
+ <div id="privacy-consent-button"><?php esc_html_e( $privacy_settings['consent_button_label'] ); ?></div>
121
+ </div>
122
+ </div>
123
+
124
+ <script type="text/javascript">
125
+ /**
126
+ * Set cookie for accepting the privacy consent.
127
+ *
128
+ * @since 1.6.0
129
+ */
130
+ function ajaxSubmit() {
131
+ document.getElementById( 'privacy-consent-button' ).innerHTML = '...';
132
+
133
+ var xmlhttp;
134
+
135
+ if ( window.XMLHttpRequest ) {
136
+ xmlhttp = new XMLHttpRequest();
137
+ } else {
138
+ xmlhttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
139
+ };
140
+
141
+ xmlhttp.onreadystatechange = function() {
142
+ if ( 4 == xmlhttp.readyState && 200 == xmlhttp.status ) {
143
+ if ( xmlhttp.responseText ) {
144
+ window.location.reload(); // Reload document
145
+ }
146
+ }
147
+ };
148
+
149
+ xmlhttp.open( 'POST', '<?php echo admin_url( 'admin-ajax.php' ); ?>', true );
150
+ xmlhttp.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded' );
151
+ xmlhttp.send( 'action=aiovg_set_cookie' );
152
+ }
153
+
154
+ document.getElementById( 'privacy-consent-button' ).addEventListener( 'click', ajaxSubmit );
155
+ </script>
156
+ </body>
157
+ </html>
public/templates/player-html5.php ADDED
@@ -0,0 +1,518 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Video Player: Mediaelementjs.
5
+ *
6
+ * @link https://plugins360.com
7
+ * @since 1.6.0
8
+ *
9
+ * @package All_In_One_Video_Gallery
10
+ */
11
+
12
+ // Video Sources
13
+ $types = array(
14
+ 'all' => array( 'mp4', 'webm', 'ogv', 'youtube', 'vimeo', 'dailymotion', 'facebook' ),
15
+ 'default' => array( 'mp4', 'webm', 'ogv' ),
16
+ 'youtube' => array( 'youtube' ),
17
+ 'vimeo' => array( 'vimeo' ),
18
+ 'dailymotion' => array( 'dailymotion' ),
19
+ 'facebook' => array( 'facebook' )
20
+ );
21
+
22
+ if ( ! empty( $post_meta ) ) {
23
+ $types = array_key_exists( $post_meta['type'][0], $types ) ? $types[ $post_meta['type'][0] ] : array();
24
+ } else {
25
+ $types = $types['all'];
26
+ }
27
+
28
+ $sources = array();
29
+ $thirdparty_providers = array();
30
+
31
+ foreach ( $types as $type ) {
32
+ if ( ! empty( $post_meta ) ) {
33
+ $src = ! empty( $post_meta[ $type ][0] ) ? $post_meta[ $type ][0] : '';
34
+ } else {
35
+ $src = isset( $_GET[ $type ] ) ? sanitize_text_field( $_GET[ $type ] ) : '';
36
+ }
37
+
38
+ if ( ! empty( $src ) ) {
39
+ $mime = "video/{$type}";
40
+
41
+ $sources[] = array(
42
+ 'type' => $mime,
43
+ 'src' => $src
44
+ );
45
+
46
+ if ( 'youtube' === $type || 'vimeo' === $type || 'dailymotion' === $type || 'facebook' === $type ) {
47
+ $thirdparty_providers[] = $type;
48
+ }
49
+ }
50
+ }
51
+
52
+ $sources = apply_filters( 'aiovg_video_sources', $sources );
53
+
54
+ // Video Attributes
55
+ $attributes = array(
56
+ 'id' => 'player',
57
+ 'playsinline' => ''
58
+ );
59
+
60
+ if ( wp_is_mobile() ) {
61
+ $autoplay = 0;
62
+ } else {
63
+ $autoplay = isset( $_GET['autoplay'] ) ? (int) $_GET['autoplay'] : (int) $player_settings['autoplay'];
64
+ }
65
+
66
+ $loop = isset( $_GET['loop'] ) ? (int) $_GET['loop'] : (int) $player_settings['loop'];
67
+
68
+ if ( ! empty( $loop ) ) {
69
+ $attributes['loop'] = true;
70
+ }
71
+
72
+ $attributes['preload'] = esc_attr( $player_settings['preload'] );
73
+
74
+ if ( isset( $_GET['poster'] ) ) {
75
+ $attributes['poster'] = $_GET['poster'];
76
+ } elseif ( ! empty( $post_meta ) ) {
77
+ $attributes['poster'] = aiovg_get_image_url( $post_meta['image_id'][0], 'large', $post_meta['image'][0], 'player' );
78
+ }
79
+
80
+ if ( ! empty( $attributes['poster'] ) ) {
81
+ $attributes['poster'] = esc_url( $attributes['poster'] );
82
+
83
+ if ( false !== strpos( $attributes['poster'], 'youtube' ) ) {
84
+ $attributes['poster'] = str_replace( array( 'https:', 'http:' ), '', $attributes['poster'] );
85
+ }
86
+ }
87
+
88
+ $attributes = apply_filters( 'aiovg_video_attributes', $attributes );
89
+
90
+ // Player Settings
91
+ $features = array( 'playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen' );
92
+ $controls = array( 'aiovg' );
93
+
94
+ foreach ( $features as $feature ) {
95
+ if ( isset( $_GET[ $feature ] ) ) {
96
+ if ( 1 == (int) $_GET[ $feature ] ) {
97
+ $controls[] = $feature;
98
+ }
99
+ } else {
100
+ if ( isset( $player_settings['controls'][ $feature ] ) ) {
101
+ $controls[] = $feature;
102
+ }
103
+ }
104
+ }
105
+
106
+ $settings = array(
107
+ 'pluginPath' => AIOVG_PLUGIN_URL . 'public/assets/mediaelement/',
108
+ 'features' => $controls,
109
+ 'autoplayRequested' => $autoplay,
110
+ 'youtube' => array( 'showinfo' => 0, 'rel' => 0, 'iv_load_policy' => 3 ),
111
+ 'showLogo' => 0,
112
+ 'showCustomContextMenu' => 0
113
+ );
114
+
115
+ if ( ! empty( $brand_settings ) ) {
116
+ $settings['showLogo'] = (int) $brand_settings['show_logo'];
117
+ $settings['logoImage'] = esc_url_raw( $brand_settings['logo_image'] );
118
+ $settings['logoLink'] = esc_url_raw( $brand_settings['logo_link'] );
119
+ $settings['logoPosition'] = sanitize_text_field( $brand_settings['logo_position'] );
120
+ $settings['logoMargin'] = (int) $brand_settings['logo_margin'];
121
+ $settings['showCustomContextMenu'] = ! empty( $brand_settings['copyright_text'] ) ? 1 : 0;
122
+ }
123
+
124
+ $settings = apply_filters( 'aiovg_player_settings', $settings );
125
+
126
+ // Video Tracks
127
+ $tracks = array();
128
+
129
+ if ( in_array( 'tracks', $settings['features'] ) && ! empty( $post_meta['track'] ) ) {
130
+ foreach ( $post_meta['track'] as $track ) {
131
+ $tracks[] = unserialize( $track );
132
+ }
133
+ }
134
+
135
+ $tracks = apply_filters( 'aiovg_video_tracks', $tracks );
136
+ ?>
137
+ <!DOCTYPE html>
138
+ <html>
139
+ <head>
140
+ <meta charset="utf-8">
141
+ <meta name="viewport" content="width=device-width, initial-scale=1">
142
+ <?php if ( $post_id > 0 ) : ?>
143
+ <title><?php echo wp_kses_post( get_the_title( $post_id ) ); ?></title>
144
+ <link rel="canonical" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
145
+ <meta property="og:url" content="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
146
+ <?php endif; ?>
147
+ <link rel="stylesheet" href="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/mediaelementplayer.css?v=4.2.9" />
148
+
149
+ <?php do_action( 'aiovg_player_head' ); ?>
150
+
151
+ <style type="text/css">
152
+ html,
153
+ body,
154
+ video,
155
+ iframe {
156
+ width: 100% !important;
157
+ height: 100% !important;
158
+ margin:0 !important;
159
+ padding:0 !important;
160
+ overflow: hidden;
161
+ }
162
+
163
+ video,
164
+ iframe {
165
+ display: block;
166
+ }
167
+
168
+ .mejs__container,
169
+ .mejs__layer {
170
+ width: 100% !important;
171
+ height: 100% !important;
172
+ }
173
+
174
+ .mejs__captions-layer {
175
+ pointer-events: none;
176
+ }
177
+
178
+ .mejs__logo {
179
+ position: absolute;
180
+ width: auto !important;
181
+ height: auto !important;
182
+ max-width: 150px;
183
+ z-index: 9;
184
+ cursor: pointer;
185
+ }
186
+
187
+ .mejs__logo img {
188
+ display: block;
189
+ opacity: 0.5;
190
+ }
191
+
192
+ .mejs__logo:hover img {
193
+ opacity: 1;
194
+ }
195
+
196
+ .mejs__logo-topleft {
197
+ top: 0;
198
+ left: 0;
199
+ }
200
+
201
+ .mejs__logo-topright {
202
+ top: 0;
203
+ right: 0;
204
+ }
205
+
206
+ .mejs__logo-bottomleft {
207
+ bottom: 40px;
208
+ left: 0;
209
+ }
210
+
211
+ .mejs__logo-bottomright {
212
+ bottom: 40px;
213
+ right: 0;
214
+ }
215
+
216
+ .contextmenu {
217
+ position: absolute;
218
+ top: 0;
219
+ left: 0;
220
+ margin: 0;
221
+ padding: 0;
222
+ background: #fff;
223
+ border-radius: 2px;
224
+ box-shadow: 1px 1px 2px #333;
225
+ z-index: 9999999999; /* make sure it shows on fullscreen */
226
+ }
227
+
228
+ .contextmenu-item {
229
+ margin: 0;
230
+ padding: 8px 12px;
231
+ font-family: 'Helvetica', Arial, serif;
232
+ font-size: 12px;
233
+ color: #222;
234
+ white-space: nowrap;
235
+ cursor: pointer;
236
+ }
237
+ </style>
238
+ </head>
239
+ <body>
240
+ <video <?php the_aiovg_video_attributes( $attributes ); ?>>
241
+ <?php
242
+ // Video Sources
243
+ foreach ( $sources as $source ) {
244
+ printf( '<source type="%s" src="%s" />', esc_attr( $source['type'] ), esc_url_raw( $source['src'] ) );
245
+ }
246
+
247
+ // Video Tracks
248
+ foreach ( $tracks as $track ) {
249
+ printf( '<track src="%s" kind="subtitles" srclang="%s" label="%s">', esc_url_raw( $track['src'] ), esc_attr( $track['srclang'] ), esc_attr( $track['label'] ) );
250
+ }
251
+ ?>
252
+ </video>
253
+
254
+ <?php if ( ! empty( $brand_settings['copyright_text'] ) ) : ?>
255
+ <div id="contextmenu" class="contextmenu" style="display: none;">
256
+ <div class="contextmenu-item"><?php esc_html_e( $brand_settings['copyright_text'] ); ?></div>
257
+ </div>
258
+ <?php endif; ?>
259
+
260
+ <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/mediaelement-and-player.min.js?v=4.2.9" type="text/javascript"></script>
261
+ <?php if ( in_array( 'vimeo', $thirdparty_providers ) ) : ?>
262
+ <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/vimeo.min.js?v=4.2.9" type="text/javascript"></script>
263
+ <?php endif; ?>
264
+ <?php if ( in_array( 'dailymotion', $thirdparty_providers ) ) : ?>
265
+ <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/dailymotion.min.js?v=4.2.9" type="text/javascript"></script>
266
+ <?php endif; ?>
267
+ <?php if ( in_array( 'facebook', $thirdparty_providers ) ) : ?>
268
+ <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/facebook.min.js?v=4.2.9" type="text/javascript"></script>
269
+ <?php endif; ?>
270
+
271
+ <?php do_action( 'aiovg_player_footer' ); ?>
272
+
273
+ <script type="text/javascript">
274
+ /**
275
+ * Check if HTML5 video autoplay is supported.
276
+ */
277
+ (function () {
278
+ 'use strict';
279
+
280
+ var autoplayAllowed, autoplayRequiresMuted;
281
+
282
+ var videoElement = document.createElement( 'video' );
283
+ videoElement.id = 'aiovg-video-hidden';
284
+ videoElement.src = "data:video/mp4;base64,AAAAFGZ0eXBNU05WAAACAE1TTlYAAAOUbW9vdgAAAGxtdmhkAAAAAM9ghv7PYIb+AAACWAAACu8AAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAnh0cmFrAAAAXHRraGQAAAAHz2CG/s9ghv4AAAABAAAAAAAACu8AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAFAAAAA4AAAAAAHgbWRpYQAAACBtZGhkAAAAAM9ghv7PYIb+AAALuAAANq8AAAAAAAAAIWhkbHIAAAAAbWhscnZpZGVBVlMgAAAAAAABAB4AAAABl21pbmYAAAAUdm1oZAAAAAAAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAVdzdGJsAAAAp3N0c2QAAAAAAAAAAQAAAJdhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAFAAOABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAAEmNvbHJuY2xjAAEAAQABAAAAL2F2Y0MBTUAz/+EAGGdNQDOadCk/LgIgAAADACAAAAMA0eMGVAEABGjuPIAAAAAYc3R0cwAAAAAAAAABAAAADgAAA+gAAAAUc3RzcwAAAAAAAAABAAAAAQAAABxzdHNjAAAAAAAAAAEAAAABAAAADgAAAAEAAABMc3RzegAAAAAAAAAAAAAADgAAAE8AAAAOAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA4AAAAOAAAAFHN0Y28AAAAAAAAAAQAAA7AAAAA0dXVpZFVTTVQh0k/Ou4hpXPrJx0AAAAAcTVREVAABABIAAAAKVcQAAAAAAAEAAAAAAAAAqHV1aWRVU01UIdJPzruIaVz6ycdAAAAAkE1URFQABAAMAAAAC1XEAAACHAAeAAAABBXHAAEAQQBWAFMAIABNAGUAZABpAGEAAAAqAAAAASoOAAEAZABlAHQAZQBjAHQAXwBhAHUAdABvAHAAbABhAHkAAAAyAAAAA1XEAAEAMgAwADAANQBtAGUALwAwADcALwAwADYAMAA2ACAAMwA6ADUAOgAwAAABA21kYXQAAAAYZ01AM5p0KT8uAiAAAAMAIAAAAwDR4wZUAAAABGjuPIAAAAAnZYiAIAAR//eBLT+oL1eA2Nlb/edvwWZflzEVLlhlXtJvSAEGRA3ZAAAACkGaAQCyJ/8AFBAAAAAJQZoCATP/AOmBAAAACUGaAwGz/wDpgAAAAAlBmgQCM/8A6YEAAAAJQZoFArP/AOmBAAAACUGaBgMz/wDpgQAAAAlBmgcDs/8A6YEAAAAJQZoIBDP/AOmAAAAACUGaCQSz/wDpgAAAAAlBmgoFM/8A6YEAAAAJQZoLBbP/AOmAAAAACkGaDAYyJ/8AFBAAAAAKQZoNBrIv/4cMeQ==";
285
+ videoElement.autoplay = true;
286
+ videoElement.style.position = 'fixed';
287
+ videoElement.style.left = '5000px';
288
+
289
+ document.getElementsByTagName( 'body' )[0].appendChild( videoElement );
290
+ var videoContent = document.getElementById( 'aiovg-video-hidden' );
291
+
292
+ function checkAutoplaySupport() {
293
+ // Check if autoplay is supported.
294
+ var playPromise = videoContent.play();
295
+ if ( playPromise !== undefined ) {
296
+ playPromise.then( onAutoplayWithSoundSuccess ).catch( onAutoplayWithSoundFail );
297
+ } else {
298
+ autoplayAllowed = false;
299
+ autoplayRequiresMuted = false;
300
+ autoplayChecksResolved();
301
+ }
302
+ }
303
+
304
+ function onAutoplayWithSoundSuccess() {
305
+ // If we make it here, unmuted autoplay works.
306
+ videoContent.pause();
307
+ autoplayAllowed = true;
308
+ autoplayRequiresMuted = false;
309
+ autoplayChecksResolved();
310
+ }
311
+
312
+ function onAutoplayWithSoundFail() {
313
+ // Unmuted autoplay failed. Now try muted autoplay.
314
+ checkMutedAutoplaySupport();
315
+ }
316
+
317
+ function checkMutedAutoplaySupport() {
318
+ videoContent.volume = 0;
319
+ videoContent.muted = true;
320
+ var playPromise = videoContent.play();
321
+ if ( playPromise !== undefined ) {
322
+ playPromise.then( onMutedAutoplaySuccess ).catch( onMutedAutoplayFail );
323
+ }
324
+ }
325
+
326
+ function onMutedAutoplaySuccess() {
327
+ // If we make it here, muted autoplay works but unmuted autoplay does not.
328
+ videoContent.pause();
329
+ autoplayAllowed = true;
330
+ autoplayRequiresMuted = true;
331
+ autoplayChecksResolved();
332
+ }
333
+
334
+ function onMutedAutoplayFail() {
335
+ // Both muted and unmuted autoplay failed. Fall back to click to play.
336
+ videoContent.volume = 1;
337
+ videoContent.muted = false;
338
+ autoplayAllowed = false;
339
+ autoplayRequiresMuted = false;
340
+ autoplayChecksResolved();
341
+ }
342
+
343
+ function autoplayChecksResolved() {
344
+ document.getElementsByTagName( 'body' )[0].removeChild( videoElement );
345
+
346
+ // Announce to the World!
347
+ window.aiovgAutoplayChecksResolved = true;
348
+ window.aiovgAutoplayAllowed = autoplayAllowed;
349
+ window.aiovgAutoplayRequiresMuted = autoplayRequiresMuted;
350
+ };
351
+
352
+ // ...
353
+ checkAutoplaySupport();
354
+ })();
355
+
356
+ /**
357
+ * MediaElement.js Integration.
358
+ */
359
+ (function() {
360
+ 'use strict';
361
+
362
+ ///////////////////////////////////////
363
+ ///////////////////////////////////////
364
+ //
365
+ // H E L P E R F U N C T I O N S
366
+ //
367
+ ///////////////////////////////////////
368
+ ///////////////////////////////////////
369
+
370
+ function ajaxSubmit( params, id ) {
371
+ var xmlhttp;
372
+
373
+ if ( window.XMLHttpRequest ) {
374
+ xmlhttp = new XMLHttpRequest();
375
+ } else {
376
+ xmlhttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
377
+ };
378
+
379
+ xmlhttp.onreadystatechange = function() {
380
+ if ( 4 == xmlhttp.readyState && 200 == xmlhttp.status ) {
381
+ if ( xmlhttp.responseText ) {
382
+ // Do nothing
383
+ }
384
+ }
385
+ };
386
+
387
+ xmlhttp.open( 'POST', '<?php echo admin_url( 'admin-ajax.php' ); ?>', true );
388
+ xmlhttp.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded' );
389
+ xmlhttp.send( params );
390
+ }
391
+
392
+ ///////////////////////////////////////
393
+ ///////////////////////////////////////
394
+ //
395
+ // C O R E F U N C T I O N S
396
+ //
397
+ ///////////////////////////////////////
398
+ ///////////////////////////////////////
399
+
400
+ /**
401
+ * A custom mediaelementjs plugin.
402
+ */
403
+ Object.assign(MediaElementPlayer.prototype, {
404
+
405
+ buildaiovg: function buildaiovg( player, controls, layers, media ) {
406
+ var t = this;
407
+
408
+ // Logo / Watermark
409
+ if ( 1 == t.options.showLogo && '' != t.options.logoImage ) {
410
+ t.logoLayer = document.createElement( 'div' );
411
+ t.logoLayer.className = t.options.classPrefix + 'logo ' + t.options.classPrefix + 'logo-' + t.options.logoPosition;
412
+ t.logoLayer.style.margin = t.options.logoMargin + 'px';
413
+ t.logoLayer.innerHTML = '<img src="' + t.options.logoImage + '" />';
414
+
415
+ t.layers.appendChild( t.logoLayer );
416
+
417
+ if ( '' != t.options.logoLink ) {
418
+ t.logoLayer.addEventListener( 'click', function() {
419
+ top.window.location.href = t.options.logoLink;
420
+ });
421
+ }
422
+
423
+ t.container.addEventListener( 'controlsshown', function() {
424
+ t.logoLayer.style.display = '';
425
+ });
426
+
427
+ t.container.addEventListener( 'controlshidden', function() {
428
+ t.logoLayer.style.display = 'none';
429
+ });
430
+ }
431
+
432
+ // Custom ContextMenu
433
+ if ( 1 == t.options.showCustomContextMenu ) {
434
+ var contextmenu = document.getElementById( 'contextmenu' );
435
+ var timeout_handler = '';
436
+
437
+ document.addEventListener( 'contextmenu', function( e ) {
438
+ if ( 3 === e.keyCode || 3 === e.which ) {
439
+ e.preventDefault();
440
+ e.stopPropagation();
441
+
442
+ var width = contextmenu.offsetWidth,
443
+ height = contextmenu.offsetHeight,
444
+ x = e.pageX,
445
+ y = e.pageY,
446
+ doc = document.documentElement,
447
+ scrollLeft = ( window.pageXOffset || doc.scrollLeft ) - ( doc.clientLeft || 0 ),
448
+ scrollTop = ( window.pageYOffset || doc.scrollTop ) - ( doc.clientTop || 0 ),
449
+ left = x + width > window.innerWidth + scrollLeft ? x - width : x,
450
+ top = y + height > window.innerHeight + scrollTop ? y - height : y;
451
+
452
+ contextmenu.style.display = '';
453
+ contextmenu.style.left = left + 'px';
454
+ contextmenu.style.top = top + 'px';
455
+
456
+ clearTimeout( timeout_handler );
457
+ timeout_handler = setTimeout(function() {
458
+ contextmenu.style.display = 'none';
459
+ }, 1500 );
460
+ }
461
+ });
462
+
463
+ if ( '' != t.options.logoLink ) {
464
+ contextmenu.addEventListener( 'click', function() {
465
+ top.window.location.href = t.options.logoLink;
466
+ });
467
+ }
468
+
469
+ document.addEventListener( 'click', function() {
470
+ contextmenu.style.display = 'none';
471
+ });
472
+ }
473
+ }
474
+
475
+ });
476
+
477
+ /**
478
+ * Initialize the player.
479
+ */
480
+ var settings = <?php echo json_encode( $settings ); ?>;
481
+
482
+ settings.success = function( media ) {
483
+ // Autoplay
484
+ if ( settings.autoplayRequested ) {
485
+ if ( window.aiovgAutoplayChecksResolved ) {
486
+ if ( window.aiovgAutoplayAllowed && ! window.aiovgAutoplayRequiresMuted ) {
487
+ media.play();
488
+ }
489
+ } else {
490
+ var intervalHandler = setInterval(
491
+ function() {
492
+ if ( window.aiovgAutoplayChecksResolved ) {
493
+ clearInterval( intervalHandler );
494
+ if ( window.aiovgAutoplayAllowed && ! window.aiovgAutoplayRequiresMuted ) {
495
+ media.play();
496
+ }
497
+ }
498
+ },
499
+ 100 ); // every 100ms
500
+ }
501
+ }
502
+
503
+ // Fired when the media is ready to start playing
504
+ var views_count_updated = 0;
505
+
506
+ media.addEventListener( 'play', function( e ) {
507
+ if ( ! views_count_updated ) {
508
+ ajaxSubmit( 'action=aiovg_update_views_count&post_id=<?php echo $post_id; ?>&security=<?php echo wp_create_nonce( 'aiovg_video_{$post_id}_views_nonce' ); ?>', 'update_views_count' );
509
+ views_count_updated = 1;
510
+ };
511
+ });
512
+ }
513
+
514
+ var player = new MediaElementPlayer( 'player', settings );
515
+ })();
516
+ </script>
517
+ </body>
518
+ </html>
public/templates/player-iframe.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Video Player: Iframe Embed Code.
5
+ *
6
+ * @link https://plugins360.com
7
+ * @since 1.6.0
8
+ *
9
+ * @package All_In_One_Video_Gallery
10
+ */
11
+
12
+ $type = '';
13
+ $src = '';
14
+
15
+ if ( ! empty( $post_meta ) ) {
16
+ $type = $post_meta['type'][0];
17
+
18
+ if ( 'embedcode' == $type ) {
19
+ $document = new DOMDocument();
20
+ $document->loadHTML( $post_meta['embedcode'][0] );
21
+
22
+ $iframes = $document->getElementsByTagName( 'iframe' );
23
+ $src = $iframes->item(0)->getAttribute( 'src' );
24
+ }
25
+
26
+ aiovg_update_views_count( $post_id );
27
+ }
28
+
29
+ if ( 'embedcode' != $type ) {
30
+ foreach ( $embedded_sources as $source ) {
31
+ $is_src_found = 0;
32
+
33
+ if ( ! empty( $post_meta ) ) {
34
+ if ( $source == $type ) {
35
+ $is_src_found = 1;
36
+ $src = $post_meta[ $type ][0];
37
+ }
38
+ } elseif ( isset( $_GET[ $source ] ) ) {
39
+ $is_src_found = 1;
40
+ $src = urldecode( $_GET[ $source ] );
41
+ }
42
+
43
+ if ( $is_src_found ) {
44
+ switch ( $source ) {
45
+ case 'youtube':
46
+ $src = 'https://www.youtube.com/embed/' . aiovg_get_youtube_id_from_url( $src ) . '?showinfo=0&rel=0&iv_load_policy=3';
47
+ break;
48
+ case 'vimeo':
49
+ $src = 'https://player.vimeo.com/video/' . aiovg_get_vimeo_id_from_url( $src ) . '?title=0&byline=0&portrait=0';
50
+ break;
51
+ case 'dailymotion':
52
+ $src = 'https://www.dailymotion.com/embed/video/' . aiovg_get_dailymotion_id_from_url( $src ) . '?queue-autoplay-next=0&queue-enable=0&sharing-enable=0&ui-logo=0&ui-start-screen-info=0';
53
+ break;
54
+ case 'facebook':
55
+ $src = 'https://www.facebook.com/plugins/video.php?href=' . urlencode( $src ) . '&width=560&height=315&show_text=false&appId';
56
+ break;
57
+ }
58
+
59
+ $features = array( 'playpause', 'current', 'progress', 'duration', 'volume', 'fullscreen' );
60
+ $controls = array();
61
+
62
+ foreach ( $features as $feature ) {
63
+ if ( isset( $_GET[ $feature ] ) ) {
64
+ if ( 1 == (int) $_GET[ $feature ] ) {
65
+ $controls[] = $feature;
66
+ }
67
+ } else {
68
+ if ( isset( $player_settings['controls'][ $feature ] ) ) {
69
+ $controls[] = $feature;
70
+ }
71
+ }
72
+ }
73
+
74
+ if ( empty( $controls ) ) {
75
+ $src = add_query_arg( 'controls', 0, $src );
76
+ } else {
77
+ if ( ! array_key_exists( 'fullscreen', $controls ) ) {
78
+ $src = add_query_arg( 'fs', 0, $src );
79
+ }
80
+ }
81
+
82
+ $autoplay = isset( $_GET[ 'autoplay' ] ) ? $_GET['autoplay'] : $player_settings['autoplay'];
83
+ $src = add_query_arg( 'autoplay', (int) $autoplay, $src );
84
+
85
+ $loop = isset( $_GET[ 'loop' ] ) ? $_GET['loop'] : $player_settings['loop'];
86
+ $src = add_query_arg( 'loop', (int) $loop, $src );
87
+ }
88
+ }
89
+ }
90
+ ?>
91
+ <!DOCTYPE html>
92
+ <html>
93
+ <head>
94
+ <meta charset="utf-8">
95
+ <meta name="viewport" content="width=device-width, initial-scale=1">
96
+ <?php if ( $post_id > 0 ) : ?>
97
+ <title><?php echo wp_kses_post( get_the_title( $post_id ) ); ?></title>
98
+ <link rel="canonical" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
99
+ <meta property="og:url" content="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
100
+ <?php endif; ?>
101
+
102
+ <style type="text/css">
103
+ html,
104
+ body,
105
+ iframe {
106
+ width: 100% !important;
107
+ height: 100% !important;
108
+ margin: 0 !important;
109
+ padding: 0 !important;
110
+ overflow: hidden;
111
+ }
112
+ </style>
113
+ </head>
114
+ <body>
115
+ <iframe width="560" height="315" src="<?php echo esc_url_raw( $src ); ?>" frameborder="0" scrolling="no" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
116
+ </body>
117
+ </html>
public/templates/player.php CHANGED
@@ -13,592 +13,50 @@ $player_settings = get_option( 'aiovg_player_settings' );
13
  $privacy_settings = get_option( 'aiovg_privacy_settings' );
14
  $brand_settings = get_option( 'aiovg_brand_settings', array() );
15
 
16
- $post_id = (int) get_query_var( 'aiovg_video', 0 );
17
- $post_meta = array();
 
 
 
18
 
19
  if ( $post_id > 0 ) {
20
  $post_type = get_post_type( $post_id );
21
 
22
  if ( 'aiovg_videos' == $post_type ) {
23
  $post_meta = get_post_meta( $post_id );
24
- }
25
- }
26
-
27
- // Video Sources
28
- $types = array(
29
- 'all' => array( 'mp4', 'webm', 'ogv', 'youtube', 'vimeo', 'dailymotion', 'facebook' ),
30
- 'default' => array( 'mp4', 'webm', 'ogv' ),
31
- 'youtube' => array( 'youtube' ),
32
- 'vimeo' => array( 'vimeo' ),
33
- 'dailymotion' => array( 'dailymotion' ),
34
- 'facebook' => array( 'facebook' )
35
- );
36
-
37
- if ( ! empty( $post_meta ) ) {
38
- $types = array_key_exists( $post_meta['type'][0], $types ) ? $types[ $post_meta['type'][0] ] : array();
39
- } else {
40
- $types = $types['all'];
41
- }
42
-
43
- $sources = array();
44
- $thirdparty_providers = array();
45
-
46
- foreach ( $types as $type ) {
47
- if ( ! empty( $post_meta ) ) {
48
- $src = ! empty( $post_meta[ $type ][0] ) ? $post_meta[ $type ][0] : '';
49
- } else {
50
- $src = isset( $_GET[ $type ] ) ? sanitize_text_field( $_GET[ $type ] ) : '';
51
- }
52
-
53
- if ( ! empty( $src ) ) {
54
- $mime = "video/{$type}";
55
 
56
- $sources[] = array(
57
- 'type' => $mime,
58
- 'src' => $src
59
- );
60
-
61
- if ( 'youtube' === $type || 'vimeo' === $type || 'dailymotion' === $type || 'facebook' === $type ) {
62
- $thirdparty_providers[] = $type;
63
  }
64
- }
65
- }
66
-
67
- $sources = apply_filters( 'aiovg_video_sources', $sources );
68
-
69
- // Video Attributes
70
- $attributes = array(
71
- 'id' => 'player',
72
- 'playsinline' => ''
73
- );
74
-
75
- if ( wp_is_mobile() ) {
76
- $autoplay = 0;
77
- } else {
78
- $autoplay = isset( $_GET['autoplay'] ) ? (int) $_GET['autoplay'] : (int) $player_settings['autoplay'];
79
- }
80
-
81
- $loop = isset( $_GET['loop'] ) ? (int) $_GET['loop'] : $player_settings['loop'];
82
-
83
- if ( ! empty( $loop ) ) {
84
- $attributes['loop'] = true;
85
- }
86
-
87
- $attributes['preload'] = esc_attr( $player_settings['preload'] );
88
-
89
- if ( isset( $_GET['poster'] ) ) {
90
- $attributes['poster'] = $_GET['poster'];
91
- } elseif ( ! empty( $post_meta ) ) {
92
- $attributes['poster'] = aiovg_get_image_url( $post_meta['image_id'][0], 'large', $post_meta['image'][0], 'player' );
93
- }
94
-
95
- if( ! empty( $attributes['poster'] ) ) {
96
- $attributes['poster'] = esc_url( $attributes['poster'] );
97
-
98
- if ( false !== strpos( $attributes['poster'], 'youtube' ) ) {
99
- $attributes['poster'] = str_replace( array( 'https:', 'http:' ), '', $attributes['poster'] );
100
- }
101
- }
102
-
103
- $use_native_controls = 0;
104
- $show_privacy_consent = 0;
105
-
106
- if ( count( $thirdparty_providers ) > 0 ) {
107
- if ( wp_is_mobile() ) {
108
- $use_native_controls = 1;
109
  }
110
-
111
- if ( ! isset( $_COOKIE['aiovg_gdpr_consent'] ) && ! empty( $privacy_settings['show_consent'] ) && ! empty( $privacy_settings['consent_message'] ) && ! empty( $privacy_settings['consent_button_label'] ) ) {
112
- $use_native_controls = 0;
113
- $show_privacy_consent = 1;
114
- }
115
- }
116
-
117
- if ( 1 == $use_native_controls ) {
118
- $attributes['poster'] = '';
119
- $attributes['controls'] = '';
120
  }
121
 
122
- $attributes = apply_filters( 'aiovg_video_attributes', $attributes );
123
-
124
- // Player Settings
125
- $features = array( 'playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen' );
126
- $controls = array( 'aiovg' );
127
-
128
- foreach ( $features as $feature ) {
129
- if ( isset( $_GET[ $feature ] ) ) {
130
- if ( 1 == (int) $_GET[ $feature ] ) {
131
- $controls[] = $feature;
132
  }
133
- } else {
134
- if ( isset( $player_settings['controls'][ $feature ] ) ) {
135
- $controls[] = $feature;
136
- }
137
- }
138
- }
139
-
140
- $settings = array(
141
- 'pluginPath' => AIOVG_PLUGIN_URL . 'public/assets/mediaelement/',
142
- 'features' => $controls,
143
- 'autoplayRequested' => $autoplay,
144
- 'iPadUseNativeControls' => $use_native_controls,
145
- 'iPhoneUseNativeControls' => $use_native_controls,
146
- 'AndroidUseNativeControls' => $use_native_controls,
147
- 'youtube' => array( 'showinfo' => 0, 'rel' => 0, 'iv_load_policy' => 3 ),
148
- 'showPrivacyConsent' => $show_privacy_consent,
149
- 'privacyConsentMessage' => wp_kses_post( trim( $privacy_settings['consent_message'] ) ),
150
- 'privacyConsentButtonLabel' => sanitize_text_field( $privacy_settings['consent_button_label'] ),
151
- 'showLogo' => 0,
152
- 'showCustomContextMenu' => 0
153
- );
154
-
155
- if ( ! empty( $brand_settings ) ) {
156
- $settings['showLogo'] = (int) $brand_settings['show_logo'];
157
- $settings['logoImage'] = esc_url_raw( $brand_settings['logo_image'] );
158
- $settings['logoLink'] = esc_url_raw( $brand_settings['logo_link'] );
159
- $settings['logoPosition'] = sanitize_text_field( $brand_settings['logo_position'] );
160
- $settings['logoMargin'] = (int) $brand_settings['logo_margin'];
161
- $settings['showCustomContextMenu'] = ! empty( $brand_settings['copyright_text'] ) ? 1 : 0;
162
- }
163
-
164
- $settings = apply_filters( 'aiovg_player_settings', $settings );
165
-
166
- // Video Tracks
167
- $tracks = array();
168
-
169
- if ( in_array( 'tracks', $settings['features'] ) && ! empty( $post_meta['track'] ) ) {
170
- foreach ( $post_meta['track'] as $track ) {
171
- $tracks[] = unserialize( $track );
172
- }
173
  }
174
 
175
- $tracks = apply_filters( 'aiovg_video_tracks', $tracks );
176
- ?>
177
- <!DOCTYPE html>
178
- <html>
179
- <head>
180
- <meta charset="utf-8">
181
- <?php if ( $post_id > 0 ) : ?>
182
- <title><?php echo wp_kses_post( get_the_title( $post_id ) ); ?></title>
183
- <link rel="canonical" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
184
- <meta property="og:url" content="<?php echo esc_url( get_permalink( $post_id ) ); ?>" />
185
- <?php endif; ?>
186
- <link rel="stylesheet" href="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/mediaelementplayer.css?v=4.2.9" />
187
-
188
- <?php do_action( 'aiovg_player_head' ); ?>
189
-
190
- <style type="text/css">
191
- html,
192
- body,
193
- video,
194
- iframe {
195
- width: 100% !important;
196
- height: 100% !important;
197
- margin:0 !important;
198
- padding:0 !important;
199
- overflow: hidden;
200
- }
201
-
202
- video,
203
- iframe {
204
- display: block;
205
- }
206
-
207
- .mejs__container,
208
- .mejs__layer {
209
- width: 100% !important;
210
- height: 100% !important;
211
- }
212
-
213
- .mejs__captions-layer {
214
- pointer-events: none;
215
- }
216
-
217
- .mejs__logo {
218
- position: absolute;
219
- width: auto !important;
220
- height: auto !important;
221
- max-width: 150px;
222
- z-index: 9;
223
- cursor: pointer;
224
- }
225
-
226
- .mejs__logo img {
227
- display: block;
228
- opacity: 0.5;
229
- }
230
-
231
- .mejs__logo:hover img {
232
- opacity: 1;
233
- }
234
-
235
- .mejs__logo-topleft {
236
- top: 0;
237
- left: 0;
238
- }
239
-
240
- .mejs__logo-topright {
241
- top: 0;
242
- right: 0;
243
- }
244
-
245
- .mejs__logo-bottomleft {
246
- bottom: 40px;
247
- left: 0;
248
- }
249
-
250
- .mejs__logo-bottomright {
251
- bottom: 40px;
252
- right: 0;
253
- }
254
-
255
- .mejs__privacy {
256
- color: #FFF;
257
- text-align: center;
258
- z-index: 999;
259
- }
260
-
261
- .mejs__privacy-consent-block {
262
- margin: 15px;
263
- padding: 15px;
264
- background: #000;
265
- border-radius: 3px;
266
- opacity: 0.9;
267
- }
268
-
269
- .mejs__privacy-consent-button {
270
- display: inline-block;
271
- margin-top: 10px;
272
- padding: 5px 15px;
273
- background: #F00;
274
- border-radius: 3px;
275
- cursor: pointer;
276
- }
277
-
278
- .mejs__privacy-consent-button:hover {
279
- opacity: 0.8;
280
- }
281
-
282
- .contextmenu {
283
- position: absolute;
284
- top: 0;
285
- left: 0;
286
- margin: 0;
287
- padding: 0;
288
- background: #fff;
289
- border-radius: 2px;
290
- box-shadow: 1px 1px 2px #333;
291
- z-index: 9999999999; /* make sure it shows on fullscreen */
292
- }
293
-
294
- .contextmenu-item {
295
- margin: 0;
296
- padding: 8px 12px;
297
- font-family: 'Helvetica', Arial, serif;
298
- font-size: 12px;
299
- color: #222;
300
- white-space: nowrap;
301
- cursor: pointer;
302
- }
303
- </style>
304
- </head>
305
- <body<?php if ( 1 == $use_native_controls ) echo ' style="background-color: #000;"'; ?>>
306
- <video <?php the_aiovg_video_attributes( $attributes ); ?>>
307
- <?php
308
- // Video Sources
309
- if ( 0 == $show_privacy_consent ) {
310
- foreach ( $sources as $source ){
311
- printf( '<source type="%s" src="%s" />', esc_attr( $source['type'] ), esc_url_raw( $source['src'] ) );
312
- }
313
- }
314
-
315
- // Video Tracks
316
- foreach ( $tracks as $track ) {
317
- printf( '<track src="%s" kind="subtitles" srclang="%s" label="%s">', esc_url_raw( $track['src'] ), esc_attr( $track['srclang'] ), esc_attr( $track['label'] ) );
318
  }
319
- ?>
320
- </video>
321
-
322
- <?php if ( ! empty( $brand_settings['copyright_text'] ) ) : ?>
323
- <div id="contextmenu" class="contextmenu" style="display: none;">
324
- <div class="contextmenu-item"><?php esc_html_e( $brand_settings['copyright_text'] ); ?></div>
325
- </div>
326
- <?php endif; ?>
327
-
328
- <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/mediaelement-and-player.min.js?v=4.2.9" type="text/javascript"></script>
329
- <?php if ( in_array( 'vimeo', $thirdparty_providers ) ) : ?>
330
- <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/vimeo.min.js?v=4.2.9" type="text/javascript"></script>
331
- <?php endif; ?>
332
- <?php if ( in_array( 'dailymotion', $thirdparty_providers ) ) : ?>
333
- <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/dailymotion.min.js?v=4.2.9" type="text/javascript"></script>
334
- <?php endif; ?>
335
- <?php if ( in_array( 'facebook', $thirdparty_providers ) ) : ?>
336
- <script src="<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/renderers/facebook.min.js?v=4.2.9" type="text/javascript"></script>
337
- <?php endif; ?>
338
-
339
- <?php do_action( 'aiovg_player_footer' ); ?>
340
-
341
- <script type="text/javascript">
342
- /**
343
- * Check if HTML5 video autoplay is supported.
344
- */
345
- (function () {
346
- 'use strict';
347
-
348
- var autoplayAllowed, autoplayRequiresMuted;
349
-
350
- var videoElement = document.createElement( 'video' );
351
- videoElement.id = 'aiovg-video-hidden';
352
- videoElement.src = "data:video/mp4;base64,AAAAFGZ0eXBNU05WAAACAE1TTlYAAAOUbW9vdgAAAGxtdmhkAAAAAM9ghv7PYIb+AAACWAAACu8AAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAnh0cmFrAAAAXHRraGQAAAAHz2CG/s9ghv4AAAABAAAAAAAACu8AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAFAAAAA4AAAAAAHgbWRpYQAAACBtZGhkAAAAAM9ghv7PYIb+AAALuAAANq8AAAAAAAAAIWhkbHIAAAAAbWhscnZpZGVBVlMgAAAAAAABAB4AAAABl21pbmYAAAAUdm1oZAAAAAAAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAVdzdGJsAAAAp3N0c2QAAAAAAAAAAQAAAJdhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAFAAOABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAAEmNvbHJuY2xjAAEAAQABAAAAL2F2Y0MBTUAz/+EAGGdNQDOadCk/LgIgAAADACAAAAMA0eMGVAEABGjuPIAAAAAYc3R0cwAAAAAAAAABAAAADgAAA+gAAAAUc3RzcwAAAAAAAAABAAAAAQAAABxzdHNjAAAAAAAAAAEAAAABAAAADgAAAAEAAABMc3RzegAAAAAAAAAAAAAADgAAAE8AAAAOAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA4AAAAOAAAAFHN0Y28AAAAAAAAAAQAAA7AAAAA0dXVpZFVTTVQh0k/Ou4hpXPrJx0AAAAAcTVREVAABABIAAAAKVcQAAAAAAAEAAAAAAAAAqHV1aWRVU01UIdJPzruIaVz6ycdAAAAAkE1URFQABAAMAAAAC1XEAAACHAAeAAAABBXHAAEAQQBWAFMAIABNAGUAZABpAGEAAAAqAAAAASoOAAEAZABlAHQAZQBjAHQAXwBhAHUAdABvAHAAbABhAHkAAAAyAAAAA1XEAAEAMgAwADAANQBtAGUALwAwADcALwAwADYAMAA2ACAAMwA6ADUAOgAwAAABA21kYXQAAAAYZ01AM5p0KT8uAiAAAAMAIAAAAwDR4wZUAAAABGjuPIAAAAAnZYiAIAAR//eBLT+oL1eA2Nlb/edvwWZflzEVLlhlXtJvSAEGRA3ZAAAACkGaAQCyJ/8AFBAAAAAJQZoCATP/AOmBAAAACUGaAwGz/wDpgAAAAAlBmgQCM/8A6YEAAAAJQZoFArP/AOmBAAAACUGaBgMz/wDpgQAAAAlBmgcDs/8A6YEAAAAJQZoIBDP/AOmAAAAACUGaCQSz/wDpgAAAAAlBmgoFM/8A6YEAAAAJQZoLBbP/AOmAAAAACkGaDAYyJ/8AFBAAAAAKQZoNBrIv/4cMeQ==";
353
- videoElement.autoplay = true;
354
- videoElement.style.position = 'fixed';
355
- videoElement.style.left = '5000px';
356
-
357
- document.getElementsByTagName( 'body' )[0].appendChild( videoElement );
358
- var videoContent = document.getElementById( 'aiovg-video-hidden' );
359
-
360
- function checkAutoplaySupport() {
361
- // Check if autoplay is supported.
362
- var playPromise = videoContent.play();
363
- if ( playPromise !== undefined ) {
364
- playPromise.then( onAutoplayWithSoundSuccess ).catch( onAutoplayWithSoundFail );
365
- } else {
366
- autoplayAllowed = false;
367
- autoplayRequiresMuted = false;
368
- autoplayChecksResolved();
369
- }
370
- }
371
-
372
- function onAutoplayWithSoundSuccess() {
373
- // If we make it here, unmuted autoplay works.
374
- videoContent.pause();
375
- autoplayAllowed = true;
376
- autoplayRequiresMuted = false;
377
- autoplayChecksResolved();
378
- }
379
-
380
- function onAutoplayWithSoundFail() {
381
- // Unmuted autoplay failed. Now try muted autoplay.
382
- checkMutedAutoplaySupport();
383
- }
384
-
385
- function checkMutedAutoplaySupport() {
386
- videoContent.volume = 0;
387
- videoContent.muted = true;
388
- var playPromise = videoContent.play();
389
- if ( playPromise !== undefined ) {
390
- playPromise.then( onMutedAutoplaySuccess ).catch( onMutedAutoplayFail );
391
- }
392
- }
393
-
394
- function onMutedAutoplaySuccess() {
395
- // If we make it here, muted autoplay works but unmuted autoplay does not.
396
- videoContent.pause();
397
- autoplayAllowed = true;
398
- autoplayRequiresMuted = true;
399
- autoplayChecksResolved();
400
- }
401
-
402
- function onMutedAutoplayFail() {
403
- // Both muted and unmuted autoplay failed. Fall back to click to play.
404
- videoContent.volume = 1;
405
- videoContent.muted = false;
406
- autoplayAllowed = false;
407
- autoplayRequiresMuted = false;
408
- autoplayChecksResolved();
409
- }
410
-
411
- function autoplayChecksResolved() {
412
- document.getElementsByTagName( 'body' )[0].removeChild( videoElement );
413
-
414
- // Announce to the World!
415
- window.aiovgAutoplayChecksResolved = true;
416
- window.aiovgAutoplayAllowed = autoplayAllowed;
417
- window.aiovgAutoplayRequiresMuted = autoplayRequiresMuted;
418
- };
419
-
420
- // ...
421
- checkAutoplaySupport();
422
- })();
423
-
424
- /**
425
- * MediaElement.js Integration.
426
- */
427
- (function() {
428
- 'use strict';
429
-
430
- ///////////////////////////////////////
431
- ///////////////////////////////////////
432
- //
433
- // H E L P E R F U N C T I O N S
434
- //
435
- ///////////////////////////////////////
436
- ///////////////////////////////////////
437
-
438
- function ajaxSubmit( params, id ) {
439
- var xmlhttp;
440
-
441
- if ( window.XMLHttpRequest ) {
442
- xmlhttp = new XMLHttpRequest();
443
- } else {
444
- xmlhttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
445
- };
446
-
447
- xmlhttp.onreadystatechange = function() {
448
- if ( 4 == xmlhttp.readyState && 200 == xmlhttp.status ) {
449
- if ( xmlhttp.responseText && 'store_privacy_cookie' == id ) {
450
- window.location.reload(); // Reload document
451
- }
452
- }
453
- };
454
-
455
- xmlhttp.open( 'POST', '<?php echo admin_url( 'admin-ajax.php' ); ?>', true );
456
- xmlhttp.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded' );
457
- xmlhttp.send( params );
458
- }
459
-
460
- ///////////////////////////////////////
461
- ///////////////////////////////////////
462
- //
463
- // C O R E F U N C T I O N S
464
- //
465
- ///////////////////////////////////////
466
- ///////////////////////////////////////
467
-
468
- /**
469
- * A custom mediaelementjs plugin.
470
- */
471
- Object.assign(MediaElementPlayer.prototype, {
472
-
473
- buildaiovg: function buildaiovg( player, controls, layers, media ) {
474
- var t = this;
475
-
476
- // Privacy Consent
477
- if ( 1 == t.options.showPrivacyConsent ) {
478
- t.privacyLayer = document.createElement( 'div' );
479
- t.privacyLayer.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer ' + t.options.classPrefix + 'privacy';
480
- t.privacyLayer.innerHTML = ( '<div class="' + t.options.classPrefix + 'privacy-consent-block">' ) + ( '<div class="' + t.options.classPrefix + 'privacy-consent-message">' + t.options.privacyConsentMessage + '</div>' ) + ( '<div class="' + t.options.classPrefix + 'privacy-consent-button">' + t.options.privacyConsentButtonLabel + '</div>' ) + '</div>';
481
-
482
- t.layers.appendChild( t.privacyLayer );
483
-
484
- t.privacyLayer.querySelector( '.' + t.options.classPrefix + 'privacy-consent-button' ).addEventListener( 'click', t.aiovgOnAgreeToPrivacy.bind( t ) );
485
- }
486
-
487
- // Logo / Watermark
488
- if ( 1 == t.options.showLogo && '' != t.options.logoImage ) {
489
- t.logoLayer = document.createElement( 'div' );
490
- t.logoLayer.className = t.options.classPrefix + 'logo ' + t.options.classPrefix + 'logo-' + t.options.logoPosition;
491
- t.logoLayer.style.margin = t.options.logoMargin + 'px';
492
- t.logoLayer.innerHTML = '<img src="' + t.options.logoImage + '" />';
493
-
494
- t.layers.appendChild( t.logoLayer );
495
-
496
- if ( '' != t.options.logoLink ) {
497
- t.logoLayer.addEventListener( 'click', function() {
498
- top.window.location.href = t.options.logoLink;
499
- });
500
- }
501
-
502
- t.container.addEventListener( 'controlsshown', function() {
503
- t.logoLayer.style.display = '';
504
- });
505
-
506
- t.container.addEventListener( 'controlshidden', function() {
507
- t.logoLayer.style.display = 'none';
508
- });
509
- }
510
-
511
- // Custom ContextMenu
512
- if ( 1 == t.options.showCustomContextMenu ) {
513
- var contextmenu = document.getElementById( 'contextmenu' );
514
- var timeout_handler = '';
515
-
516
- document.addEventListener( 'contextmenu', function( e ) {
517
- if ( 3 === e.keyCode || 3 === e.which ) {
518
- e.preventDefault();
519
- e.stopPropagation();
520
-
521
- var width = contextmenu.offsetWidth,
522
- height = contextmenu.offsetHeight,
523
- x = e.pageX,
524
- y = e.pageY,
525
- doc = document.documentElement,
526
- scrollLeft = ( window.pageXOffset || doc.scrollLeft ) - ( doc.clientLeft || 0 ),
527
- scrollTop = ( window.pageYOffset || doc.scrollTop ) - ( doc.clientTop || 0 ),
528
- left = x + width > window.innerWidth + scrollLeft ? x - width : x,
529
- top = y + height > window.innerHeight + scrollTop ? y - height : y;
530
-
531
- contextmenu.style.display = '';
532
- contextmenu.style.left = left + 'px';
533
- contextmenu.style.top = top + 'px';
534
-
535
- clearTimeout( timeout_handler );
536
- timeout_handler = setTimeout(function() {
537
- contextmenu.style.display = 'none';
538
- }, 1500 );
539
- }
540
- });
541
-
542
- if ( '' != t.options.logoLink ) {
543
- contextmenu.addEventListener( 'click', function() {
544
- top.window.location.href = t.options.logoLink;
545
- });
546
- }
547
-
548
- document.addEventListener( 'click', function() {
549
- contextmenu.style.display = 'none';
550
- });
551
- }
552
- },
553
-
554
- aiovgOnAgreeToPrivacy: function aiovgOnAgreeToPrivacy() {
555
- var t = this;
556
-
557
- t.privacyLayer.querySelector( '.' + t.options.classPrefix + 'privacy-consent-button' ).innerHTML = '<?php _e( 'Please wait', 'all-in-one-video-gallery' ); ?>...';
558
- ajaxSubmit( 'action=aiovg_set_cookie', 'store_privacy_cookie' ); // Set Cookie
559
- }
560
-
561
- });
562
-
563
- /**
564
- * Initialize the player.
565
- */
566
- var settings = <?php echo json_encode( $settings ); ?>;
567
-
568
- settings.success = function( media ) {
569
- // Autoplay
570
- if ( settings.autoplayRequested ) {
571
- if ( window.aiovgAutoplayChecksResolved ) {
572
- if ( window.aiovgAutoplayAllowed && ! window.aiovgAutoplayRequiresMuted ) {
573
- media.play();
574
- }
575
- } else {
576
- var intervalHandler = setInterval(
577
- function() {
578
- if ( window.aiovgAutoplayChecksResolved ) {
579
- clearInterval( intervalHandler );
580
- if ( window.aiovgAutoplayAllowed && ! window.aiovgAutoplayRequiresMuted ) {
581
- media.play();
582
- }
583
- }
584
- },
585
- 100 ); // every 100ms
586
- }
587
- }
588
 
589
- // Fired when the media is ready to start playing
590
- var views_count_updated = 0;
591
-
592
- media.addEventListener( 'play', function( e ) {
593
- if ( ! views_count_updated ) {
594
- ajaxSubmit( 'action=aiovg_update_views_count&post_id=<?php echo $post_id; ?>&security=<?php echo wp_create_nonce( 'aiovg_video_{$post_id}_views_nonce' ); ?>', 'update_views_count' );
595
- views_count_updated = 1;
596
- };
597
- });
598
- }
599
-
600
- var player = new MediaElementPlayer( 'player', settings );
601
- })();
602
- </script>
603
- </body>
604
- </html>
13
  $privacy_settings = get_option( 'aiovg_privacy_settings' );
14
  $brand_settings = get_option( 'aiovg_brand_settings', array() );
15
 
16
+ $post_id = (int) get_query_var( 'aiovg_video', 0 );
17
+ $post_meta = array();
18
+
19
+ $embedded_sources = array( 'youtube', 'vimeo', 'dailymotion', 'facebook' );
20
+ $player_template = 'html5';
21
 
22
  if ( $post_id > 0 ) {
23
  $post_type = get_post_type( $post_id );
24
 
25
  if ( 'aiovg_videos' == $post_type ) {
26
  $post_meta = get_post_meta( $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ if ( 'embedcode' == $post_meta['type'][0] ) {
29
+ $player_template = 'iframe';
 
 
 
 
 
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
 
 
 
 
 
 
 
 
 
 
32
  }
33
 
34
+ foreach ( $embedded_sources as $source ) {
35
+ if ( wp_is_mobile() || isset( $player_settings['use_native_controls'][ $source ] ) ) {
36
+ if ( ! empty( $post_meta ) ) {
37
+ if ( $source == $post_meta['type'][0] ) {
38
+ $player_template = 'iframe';
39
+ }
40
+ } elseif ( isset( $_GET[ $source ] ) ) {
41
+ $player_template = 'iframe';
 
 
42
  }
43
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
+ if ( ! isset( $_COOKIE['aiovg_gdpr_consent'] ) && ! empty( $privacy_settings['show_consent'] ) && ! empty( $privacy_settings['consent_message'] ) && ! empty( $privacy_settings['consent_button_label'] ) ) {
47
+ if ( 'iframe' == $player_template ) {
48
+ $player_template = 'gdpr';
49
+ } else {
50
+ foreach ( $embedded_sources as $source ) {
51
+ if ( ! empty( $post_meta ) ) {
52
+ if ( $source == $post_meta['type'][0] ) {
53
+ $player_template = 'gdpr';
54
+ }
55
+ } elseif ( isset( $_GET[ $source ] ) ) {
56
+ $player_template = 'gdpr';
57
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
+ }
60
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ include AIOVG_PLUGIN_DIR . "public/templates/player-{$player_template}.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/video.php CHANGED
@@ -90,7 +90,6 @@ class AIOVG_Public_Video {
90
 
91
  // Enqueue dependencies
92
  wp_enqueue_style( AIOVG_PLUGIN_SLUG . '-public' );
93
- wp_enqueue_script( AIOVG_PLUGIN_SLUG . '-public' );
94
 
95
  // Return
96
  return aiovg_get_player_html( $post_id, $atts );
@@ -123,7 +122,6 @@ class AIOVG_Public_Video {
123
 
124
  // Enqueue dependencies
125
  wp_enqueue_style( AIOVG_PLUGIN_SLUG . '-public' );
126
- wp_enqueue_script( AIOVG_PLUGIN_SLUG . '-public' );
127
 
128
  // Process output
129
  ob_start();
90
 
91
  // Enqueue dependencies
92
  wp_enqueue_style( AIOVG_PLUGIN_SLUG . '-public' );
 
93
 
94
  // Return
95
  return aiovg_get_player_html( $post_id, $atts );
122
 
123
  // Enqueue dependencies
124
  wp_enqueue_style( AIOVG_PLUGIN_SLUG . '-public' );
 
125
 
126
  // Process output
127
  ob_start();