All-in-One Video Gallery - Version 1.3.0

Version Description

  • Tweak: "Select a Template" option removed from "WordPress Admin Panel => Video Gallery => Settings[Display] => Video Gallery Pages" settings.
  • Fix: "Autoplay" disabled in mobile devices.
  • Fix: YouTube playback issues in IOS.
Download this release

Release Info

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

Code changes from version 1.2.0 to 1.3.0

README.txt CHANGED
@@ -6,7 +6,7 @@ Tags: video, player, gallery, mp4, webm, ogv, youtube, vimeo, hls, dash, adaptiv
6
Requires at least: 4.4.0
7
Tested up to: 4.9
8
Requires PHP: 5.3.0
9
- Stable tag: 1.2.0
10
License: GPLv2 or later
11
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
@@ -82,6 +82,12 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
82
83
== Changelog ==
84
85
= 1.2.0 =
86
87
* Fix: Unfortunately, there were some bugs in the 1.1.0 release and this is an immediate release which addresses those issues.
@@ -96,6 +102,12 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
96
97
== Upgrade Notice ==
98
99
= 1.2.0 =
100
101
* Fix: Unfortunately, there were some bugs in the 1.1.0 release and this is an immediate release which addresses those issues.
6
Requires at least: 4.4.0
7
Tested up to: 4.9
8
Requires PHP: 5.3.0
9
+ Stable tag: 1.3.0
10
License: GPLv2 or later
11
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
82
83
== Changelog ==
84
85
+ = 1.3.0 =
86
+
87
+ * Tweak: "Select a Template" option removed from "WordPress Admin Panel => Video Gallery => Settings[Display] => Video Gallery Pages" settings.
88
+ * Fix: "Autoplay" disabled in mobile devices.
89
+ * Fix: YouTube playback issues in IOS.
90
+
91
= 1.2.0 =
92
93
* Fix: Unfortunately, there were some bugs in the 1.1.0 release and this is an immediate release which addresses those issues.
102
103
== Upgrade Notice ==
104
105
+ = 1.3.0 =
106
+
107
+ * Tweak: "Select a Template" option removed from "WordPress Admin Panel => Video Gallery => Settings[Display] => Video Gallery Pages" settings.
108
+ * Fix: "Autoplay" disabled in mobile devices.
109
+ * Fix: YouTube playback issues in IOS.
110
+
111
= 1.2.0 =
112
113
* Fix: Unfortunately, there were some bugs in the 1.1.0 release and this is an immediate release which addresses those issues.
admin/class-aiovg-admin-settings.php CHANGED
@@ -359,14 +359,6 @@ class AIOVG_Admin_Settings {
359
),
360
'aiovg_videos_settings' => array(
361
array(
362
- 'name' => 'template',
363
- 'label' => __( 'Select a Template', 'all-in-one-video-gallery' ),
364
- 'description' => '',
365
- 'type' => 'radio',
366
- 'options' => aiovg_get_video_templates(),
367
- 'sanitize_callback' => 'sanitize_key'
368
- ),
369
- array(
370
'name' => 'columns',
371
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
372
'description' => __( 'Enter the number of columns you like to have in the gallery view.', 'all-in-one-video-gallery' ),
359
),
360
'aiovg_videos_settings' => array(
361
array(
362
'name' => 'columns',
363
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
364
'description' => __( 'Enter the number of columns you like to have in the gallery view.', 'all-in-one-video-gallery' ),
admin/class-aiovg-admin-shortcode.php CHANGED
@@ -151,14 +151,6 @@ class AIOVG_Admin_Shortcode {
151
'value' => 0,
152
'default' => 0
153
),
154
- array(
155
- 'name' => 'template',
156
- 'label' => __( 'Select a Template', 'all-in-one-video-gallery' ),
157
- 'type' => 'select',
158
- 'options' => aiovg_get_video_templates(),
159
- 'value' => 'standard',
160
- 'default' => 'standard'
161
- ),
162
array(
163
'name' => 'columns',
164
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
151
'value' => 0,
152
'default' => 0
153
),
154
array(
155
'name' => 'columns',
156
'label' => __( 'Number of Columns', 'all-in-one-video-gallery' ),
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
13
* Description: Responsive & Lightweight Video gallery plugin. HTML5 with FLASH fallbacks. Supports any browser & video formats such as MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Facebook, etc.
14
- * Version: 1.2.0
15
* Author: Team Plugins360
16
* License: GPL-2.0+
17
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -26,7 +26,7 @@ if ( ! defined( 'WPINC' ) ) {
26
27
// The current version of the plugin
28
if ( ! defined( 'AIOVG_PLUGIN_VERSION' ) ) {
29
- define( 'AIOVG_PLUGIN_VERSION', '1.2.0' );
30
}
31
32
// The unique identifier of the plugin
11
* Plugin Name: All in One Video Gallery
12
* Plugin URI: https://plugins360.com
13
* Description: Responsive & Lightweight Video gallery plugin. HTML5 with FLASH fallbacks. Supports any browser & video formats such as MP4, WebM, OGV and embeddable players like YouTube, Vimeo, Facebook, etc.
14
+ * Version: 1.3.0
15
* Author: Team Plugins360
16
* License: GPL-2.0+
17
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
26
27
// The current version of the plugin
28
if ( ! defined( 'AIOVG_PLUGIN_VERSION' ) ) {
29
+ define( 'AIOVG_PLUGIN_VERSION', '1.3.0' );
30
}
31
32
// The unique identifier of the plugin
includes/class-aiovg-activator.php CHANGED
@@ -66,7 +66,6 @@ class AIOVG_Activator {
66
'hide_empty' => 0
67
),
68
'aiovg_videos_settings' => array(
69
- 'template' => 'standard',
70
'columns' => 3,
71
'limit' => 10,
72
'orderby' => 'date',
66
'hide_empty' => 0
67
),
68
'aiovg_videos_settings' => array(
69
'columns' => 3,
70
'limit' => 10,
71
'orderby' => 'date',
includes/functions.php CHANGED
@@ -565,22 +565,6 @@ function aiovg_get_video_source_types() {
565
566
}
567
568
- /**
569
- * Get video templates.
570
- *
571
- * @since 1.0.0
572
- * @return array Array of video templates.
573
- */
574
- function aiovg_get_video_templates() {
575
-
576
- $templates = array(
577
- 'standard' => __( 'Standard', 'all-in-one-video-gallery' )
578
- );
579
-
580
- return apply_filters( 'aiovg_video_templates', $templates );
581
-
582
- }
583
-
584
/*
585
* Get Vimeo ID from URL.
586
*
565
566
}
567
568
/*
569
* Get Vimeo ID from URL.
570
*
public/class-aiovg-public-videos.php CHANGED
@@ -280,7 +280,6 @@ class AIOVG_Public_Videos {
280
281
$this->defaults = array(
282
'title' => '',
283
- 'template' => $videos_settings['template'],
284
'ratio' => $image_settings['ratio'],
285
'columns' => $videos_settings['columns'],
286
'limit' => ! empty( $videos_settings['limit'] ) ? $videos_settings['limit'] : -1,
280
281
$this->defaults = array(
282
'title' => '',
283
'ratio' => $image_settings['ratio'],
284
'columns' => $videos_settings['columns'],
285
'limit' => ! empty( $videos_settings['limit'] ) ? $videos_settings['limit'] : -1,
public/templates/player.php CHANGED
@@ -75,7 +75,7 @@ $attributes['preload'] = esc_attr( $player_settings['preload'] );
75
$attributes = apply_filters( 'aiovg_video_attributes', $attributes );
76
77
// Sources
78
- $formats = array(
79
'all' => array( 'mp4', 'webm', 'ogv', 'youtube', 'vimeo', 'facebook' ),
80
'default' => array( 'mp4', 'webm', 'ogv' ),
81
'youtube' => array( 'youtube' ),
@@ -83,30 +83,32 @@ $formats = array(
83
'facebook' => array( 'facebook' )
84
);
85
86
- $sources = array();
87
-
88
if ( ! empty( $post_meta ) ) {
89
- $type = $post_meta['type'][0];
90
- $formats = array_key_exists( $type, $formats ) ? $formats[ $post_meta['type'][0] ] : array();
91
} else {
92
- $formats = $formats['all'];
93
}
94
95
- foreach ( $formats as $format ) {
96
97
if ( ! empty( $post_meta ) ) {
98
- $src = ! empty( $post_meta[ $format ][0] ) ? $post_meta[ $format ][0] : '';
99
} else {
100
- $src = isset( $_GET[ $format ] ) ? sanitize_text_field( $_GET[ $format ] ) : '';
101
}
102
103
- if ( ! empty( $src ) ) {
104
- $mime = "video/{$format}";
105
106
$sources[] = array(
107
'type' => $mime,
108
'src' => $src
109
);
110
}
111
112
}
@@ -125,6 +127,23 @@ if ( in_array( 'tracks', $controls ) && ! empty( $post_meta['track'] ) ) {
125
}
126
127
$tracks = apply_filters( 'aiovg_video_tracks', $tracks );
128
?>
129
<!DOCTYPE html>
130
<html>
@@ -139,7 +158,6 @@ $tracks = apply_filters( 'aiovg_video_tracks', $tracks );
139
height: 100% !important;
140
margin:0 !important;
141
padding:0 !important;
142
- background: #000;
143
overflow: hidden;
144
}
145
@@ -176,6 +194,9 @@ $tracks = apply_filters( 'aiovg_video_tracks', $tracks );
176
$( 'video' ).mediaelementplayer({
177
pluginPath: '<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/',
178
features: <?php echo json_encode( $controls ); ?>,
179
youtube: { showinfo: 0, rel: 0, iv_load_policy: 3 },
180
success: function( media ) {
181
75
$attributes = apply_filters( 'aiovg_video_attributes', $attributes );
76
77
// Sources
78
+ $types = array(
79
'all' => array( 'mp4', 'webm', 'ogv', 'youtube', 'vimeo', 'facebook' ),
80
'default' => array( 'mp4', 'webm', 'ogv' ),
81
'youtube' => array( 'youtube' ),
83
'facebook' => array( 'facebook' )
84
);
85
86
if ( ! empty( $post_meta ) ) {
87
+ $types = array_key_exists( $post_meta['type'][0], $types ) ? $types[ $post_meta['type'][0] ] : array();
88
} else {
89
+ $types = $types['all'];
90
}
91
92
+ $sources = array();
93
+ $formats = array();
94
+
95
+ foreach ( $types as $type ) {
96
97
if ( ! empty( $post_meta ) ) {
98
+ $src = ! empty( $post_meta[ $type ][0] ) ? $post_meta[ $type ][0] : '';
99
} else {
100
+ $src = isset( $_GET[ $type ] ) ? sanitize_text_field( $_GET[ $type ] ) : '';
101
}
102
103
+ if ( ! empty( $src ) ) {
104
+ $mime = "video/{$type}";
105
106
$sources[] = array(
107
'type' => $mime,
108
'src' => $src
109
);
110
+
111
+ $formats[] = $type;
112
}
113
114
}
127
}
128
129
$tracks = apply_filters( 'aiovg_video_tracks', $tracks );
130
+
131
+ // Mobile
132
+ $is_mobile = false;
133
+ $use_native_controls = 0;
134
+
135
+ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPhone|iPod|iPad|BlackBerry|Android/', $_SERVER['HTTP_USER_AGENT'] ) ) {
136
+ $is_mobile = true;
137
+ }
138
+
139
+ if ( $is_mobile ) {
140
+ $attributes['autoplay'] = false;
141
+
142
+ if ( in_array( 'youtube', $formats ) || in_array( 'vimeo', $formats ) || in_array( 'facebook', $formats ) ) {
143
+ $attributes['poster'] = '';
144
+ $use_native_controls = 1;
145
+ }
146
+ }
147
?>
148
<!DOCTYPE html>
149
<html>
158
height: 100% !important;
159
margin:0 !important;
160
padding:0 !important;
161
overflow: hidden;
162
}
163
194
$( 'video' ).mediaelementplayer({
195
pluginPath: '<?php echo AIOVG_PLUGIN_URL; ?>public/assets/mediaelement/',
196
features: <?php echo json_encode( $controls ); ?>,
197
+ AndroidUseNativeControls: <?php echo $use_native_controls; ?>,
198
+ iPadUseNativeControls: <?php echo $use_native_controls; ?>,
199
+ iPhoneUseNativeControls: <?php echo $use_native_controls; ?>,
200
youtube: { showinfo: 0, rel: 0, iv_load_policy: 3 },
201
success: function( media ) {
202
public/templates/videos-grid.php CHANGED
@@ -11,7 +11,7 @@
11
*/
12
?>
13
14
- <div class="aiovg aiovg-videos aiovg-template-<?php echo $attributes['template']; ?>">
15
<?php
16
// Display the videos count
17
if ( ! empty( $attributes['show_count'] ) ) : ?>
11
*/
12
?>
13
14
+ <div class="aiovg aiovg-videos">
15
<?php
16
// Display the videos count
17
if ( ! empty( $attributes['show_count'] ) ) : ?>
widgets/videos/class-aiovg-widget-videos.php CHANGED
@@ -55,7 +55,6 @@ class AIOVG_Widget_Videos extends WP_Widget {
55
$this->defaults = array(
56
'title' => __( 'Video Gallery', 'all-in-one-video-gallery' ),
57
'category' => array(),
58
- 'template' => $videos_settings['template'],
59
'image_position' => 'left',
60
'ratio' => $image_settings['ratio'],
61
'columns' => 1,
@@ -231,7 +230,6 @@ class AIOVG_Widget_Videos extends WP_Widget {
231
232
$instance['title'] = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
233
$instance['category'] = isset( $new_instance['category'] ) ? array_map( 'intval', $new_instance['category'] ) : array();
234
- $instance['template'] = isset( $new_instance['template'] ) ? sanitize_text_field( $new_instance['template'] ) : 'standard';
235
$instance['image_position'] = isset( $new_instance['image_position'] ) ? sanitize_text_field( $new_instance['image_position'] ) : 'left';
236
$instance['columns'] = isset( $new_instance['columns'] ) ? (int) $new_instance['columns'] : 1;
237
$instance['limit'] = isset( $new_instance['limit'] ) ? (int) $new_instance['limit'] : 0;
55
$this->defaults = array(
56
'title' => __( 'Video Gallery', 'all-in-one-video-gallery' ),
57
'category' => array(),
58
'image_position' => 'left',
59
'ratio' => $image_settings['ratio'],
60
'columns' => 1,
230
231
$instance['title'] = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
232
$instance['category'] = isset( $new_instance['category'] ) ? array_map( 'intval', $new_instance['category'] ) : array();
233
$instance['image_position'] = isset( $new_instance['image_position'] ) ? sanitize_text_field( $new_instance['image_position'] ) : 'left';
234
$instance['columns'] = isset( $new_instance['columns'] ) ? (int) $new_instance['columns'] : 1;
235
$instance['limit'] = isset( $new_instance['limit'] ) ? (int) $new_instance['limit'] : 0;
widgets/videos/templates/admin.php CHANGED
@@ -30,19 +30,6 @@
30
?>
31
</ul>
32
33
- <p>
34
- <label for="<?php echo $this->get_field_id( 'template' ); ?>"><?php _e( 'Select a Template', 'all-in-one-video-gallery' ); ?></label>
35
- <select name="<?php echo $this->get_field_name( 'template' ); ?>" id="<?php echo $this->get_field_id( 'template' ); ?>" class="widefat">
36
- <?php
37
- $options = aiovg_get_video_templates();
38
-
39
- foreach( $options as $key => $value ) {
40
- printf( '<option value="%s"%s>%s</option>', esc_attr( $key ), selected( $key, $instance['template'] ), esc_html( $value ) );
41
- }
42
- ?>
43
- </select>
44
- </p>
45
-
46
<p>
47
<label for="<?php echo $this->get_field_id( 'image_position' ); ?>"><?php _e( 'Image Position', 'all-in-one-video-gallery' ); ?></label>
48
<select name="<?php echo $this->get_field_name( 'image_position' ); ?>" id="<?php echo $this->get_field_id( 'image_position' ); ?>" class="widefat">
30
?>
31
</ul>
32
33
<p>
34
<label for="<?php echo $this->get_field_id( 'image_position' ); ?>"><?php _e( 'Image Position', 'all-in-one-video-gallery' ); ?></label>
35
<select name="<?php echo $this->get_field_name( 'image_position' ); ?>" id="<?php echo $this->get_field_id( 'image_position' ); ?>" class="widefat">
widgets/videos/templates/videos-grid-image-left.php CHANGED
@@ -11,7 +11,7 @@
11
*/
12
?>
13
14
- <div class="aiovg aiovg-widget aiovg-videos aiovg-image-left aiovg-template-<?php echo $attributes['template']; ?>">
15
<?php
16
// Start the loop
17
$class_column_container = 'col-md-' . floor( 12 / $attributes['columns'] );
11
*/
12
?>
13
14
+ <div class="aiovg aiovg-widget aiovg-videos aiovg-image-left">
15
<?php
16
// Start the loop
17
$class_column_container = 'col-md-' . floor( 12 / $attributes['columns'] );
widgets/videos/templates/videos-grid-image-top.php CHANGED
@@ -11,7 +11,7 @@
11
*/
12
?>
13
14
- <div class="aiovg aiovg-widget aiovg-videos aiovg-template-<?php echo $attributes['template']; ?>">
15
<?php
16
// Start the loop
17
$class_column_container = 'col-md-' . floor( 12 / $attributes['columns'] );
11
*/
12
?>
13
14
+ <div class="aiovg aiovg-widget aiovg-videos">
15
<?php
16
// Start the loop
17
$class_column_container = 'col-md-' . floor( 12 / $attributes['columns'] );