Video Embed & Thumbnail Generator - Version 4.7.2

Version Description

  • July XX, 2021 =
  • Added video player option "None" which will disable all plugin-related CSS and JS on the front end.
Download this release

Release Info

Developer kylegilman
Plugin Icon 128x128 Video Embed & Thumbnail Generator
Version 4.7.2
Comparing to
See all releases

Code changes from version 4.7.1 to 4.7.2

Files changed (2) hide show
  1. readme.txt +4 -3
  2. video-embed-thumbnail-generator.php +44 -17
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: video, video player, video gallery, video thumbnail, ffmpeg, resolution
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6.0
8
- Stable tag: 4.7.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -66,8 +66,6 @@ WordPress already has <a href="http://codex.wordpress.org/Embeds">a built-in sys
66
 
67
  If you're like most users and don't have FFMPEG installed on your server, the plugin relies on your browser's built-in ability to play videos. Google Chrome is best when making thumbnails because it supports the most formats. Wikipedia has <a href="http://en.wikipedia.org/wiki/HTML5_video#Browser_support">a great chart that explains which browsers work with which video formats</a>.
68
 
69
- If you were able to make thumbnails using FFMPEG before updating to version 4.2, try disabling in-browser thumbnail creation in the FFMPEG Settings tab of the plugin settings.
70
-
71
  = How can I change the watermark's size or position? =
72
 
73
  The watermark option is a simple image overlay and is styled using CSS. The default styling is
@@ -115,6 +113,9 @@ Enter the username & password in the plugin settings "FFMPEG Settings" tab, or u
115
 
116
  == Changelog ==
117
 
 
 
 
118
  = 4.7.1 - July 19, 2021 =
119
  * Updated Video.js to version 7.13.3
120
  * Fixed bug that removed existing meta_query when loading attachments, which broke Woocommerce image importing and most likely some other queries.
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6.0
8
+ Stable tag: 4.7.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
66
 
67
  If you're like most users and don't have FFMPEG installed on your server, the plugin relies on your browser's built-in ability to play videos. Google Chrome is best when making thumbnails because it supports the most formats. Wikipedia has <a href="http://en.wikipedia.org/wiki/HTML5_video#Browser_support">a great chart that explains which browsers work with which video formats</a>.
68
 
 
 
69
  = How can I change the watermark's size or position? =
70
 
71
  The watermark option is a simple image overlay and is styled using CSS. The default styling is
113
 
114
  == Changelog ==
115
 
116
+ = 4.7.2 - July XX, 2021 =
117
+ * Added video player option "None" which will disable all plugin-related CSS and JS on the front end.
118
+
119
  = 4.7.1 - July 19, 2021 =
120
  * Updated Video.js to version 7.13.3
121
  * Fixed bug that removed existing meta_query when loading attachments, which broke Woocommerce image importing and most likely some other queries.
video-embed-thumbnail-generator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Videopack (formerly Video Embed & Thumbnail Generator)
4
  Plugin URI: https://www.wordpressvideopack.com/
5
  Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
6
- Version: 4.7.1
7
  Author: Kyle Gilman
8
  Author URI: https://www.kylegilman.net/
9
  Text Domain: video-embed-thumbnail-generator
@@ -58,7 +58,7 @@ function kgvid_default_options_fn() {
58
  $edit_others_capable = kgvid_check_if_capable('edit_others_posts');
59
 
60
  $options = array(
61
- "version" => '4.7.1',
62
  "videojs_version" => '7.13.3',
63
  "embed_method" => "Video.js v7",
64
  "template" => false,
@@ -1996,6 +1996,7 @@ function kgvid_video_embed_enqueue_styles() {
1996
  }
1997
 
1998
  if ( $options['embed_method'] == "WordPress Default" ) {
 
1999
  global $wp_version;
2000
 
2001
  if ( $wp_version >= 4.9 ) {
@@ -2018,7 +2019,9 @@ function kgvid_video_embed_enqueue_styles() {
2018
  }
2019
 
2020
  //plugin-related frontend styles, requires video-js
2021
- wp_enqueue_style( 'kgvid_video_styles', plugins_url("/css/kgvid_styles.css", __FILE__), array( 'video-js' ), $options['version'] );
 
 
2022
 
2023
  if ( $options['alwaysloadscripts'] == 'on' ) {
2024
  kgvid_enqueue_shortcode_scripts();
@@ -2828,11 +2831,14 @@ function kgvid_single_video_code($query_atts, $atts, $content, $post_id) {
2828
  if ( $query_atts['align'] == "right" ) { $aligncode = ' kgvid_wrapper_auto_left'; }
2829
  }
2830
 
2831
- if ( ( $query_atts['title'] != "false" )
 
2832
  || $query_atts['embedcode'] != "false"
2833
  || $query_atts['downloadlink'] == "true"
2834
  || $options['twitter_button'] == 'on'
2835
- || $options['facebook_button'] == 'on'
 
 
2836
  ) { //generate content overlaid on video
2837
  $kgvid_meta = true;
2838
  }
@@ -2897,7 +2903,10 @@ function kgvid_single_video_code($query_atts, $atts, $content, $post_id) {
2897
  );
2898
  $video_variables = apply_filters('kgvid_video_variables', $video_variables, $query_atts, $encodevideo_info);
2899
 
2900
- if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Video.js v7" ) {
 
 
 
2901
 
2902
  $enable_resolutions_plugin = false;
2903
  $x = 20;
@@ -3132,7 +3141,10 @@ function kgvid_single_video_code($query_atts, $atts, $content, $post_id) {
3132
  $code .= $executed_shortcode;
3133
  }
3134
 
3135
- if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Video.js v7" ) {
 
 
 
3136
 
3137
  $code .= "\n\t\t\t\t".'<video id="video_'.$div_suffix.'" ';
3138
  if ( $query_atts["playsinline"] == 'true' ) { $code .= 'playsinline '; }
@@ -3142,12 +3154,23 @@ function kgvid_single_video_code($query_atts, $atts, $content, $post_id) {
3142
  if ( $query_atts["muted"] == 'true' ) { $code .= 'muted '; }
3143
  $code .= 'preload="'.$query_atts['preload'].'" ';
3144
  if ( $query_atts["poster"] != '' ) { $code .= 'poster="'.esc_attr($query_atts["poster"]).'" '; }
3145
- $code .= 'width="'.$query_atts["width"].'" height="'.esc_attr($query_atts["height"]).'"';
3146
- if ( $options['js_skin'] == "" ) { $options['js_skin'] = "vjs-default-skin"; }
3147
- if ( is_array($atts) && array_key_exists('skin', $atts) ) {
3148
- $options['js_skin'] = $atts['skin']; //allows user to set skin for individual videos using the skin="" attribute
 
 
 
 
 
 
 
 
 
 
 
 
3149
  }
3150
- $code .= ' class="fitvidsignore '.esc_attr('video-js '.$options['js_skin']).'">'."\n";
3151
 
3152
  $code .= implode("", $sources); //add the <source> tags created earlier
3153
  $code .= $track_code; //if there's a text track
@@ -3255,7 +3278,10 @@ function kgvid_single_video_code($query_atts, $atts, $content, $post_id) {
3255
  $code .= "</div>\n";
3256
  }
3257
 
3258
- if ( !empty($query_atts["watermark"]) && $query_atts["watermark"] != "false" ) {
 
 
 
3259
  $watermark_id = kgvid_url_to_id($query_atts["watermark"]);
3260
  if ( $watermark_id ) { $query_atts["watermark"] = wp_get_attachment_url($watermark_id); }
3261
  if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) {
@@ -3329,7 +3355,7 @@ function kgvid_replace_video_shortcode( $atts, $content = '' ) {
3329
 
3330
  $src_atts = array('src', 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv');
3331
  foreach ( $src_atts as $src_key ) {
3332
- if ( array_key_exists($src_key, $atts) ) {
3333
  $content = $atts[$src_key];
3334
  break;
3335
  }
@@ -4801,8 +4827,9 @@ add_action('admin_init', 'kgvid_video_embed_options_init' );
4801
 
4802
  $players = array(
4803
  "Video.js v7" => "Video.js v7",
4804
- "Video.js v5 (" . __("deprecated") . ")" => "Video.js",
4805
- __("WordPress Default", 'video-embed-thumbnail-generator') => "WordPress Default"
 
4806
  );
4807
 
4808
  $players = apply_filters('kgvid_available_video_players', $players);
@@ -4812,7 +4839,7 @@ add_action('admin_init', 'kgvid_video_embed_options_init' );
4812
  $selected = ($options['embed_method']==$value) ? 'selected="selected"' : '';
4813
  echo "<option value='$value' $selected>$name</option>";
4814
  }
4815
- echo "</select> <span class='kgvid_tooltip wp-ui-text-highlight'><span class='kgvid_tooltip_classic'>".__('Video.js version 7 is the default player. You can also choose the WordPress Default Mediaelement.js player which may already be skinned to match your theme.', 'video-embed-thumbnail-generator')."</span></span></td></tr></tbody></table>\n";
4816
 
4817
  $sampleheight = intval($options['height']) + 50;
4818
  echo "<div class='kgvid_setting_nearvid' style='width:".$options['width']."px;'>";
3
  Plugin Name: Videopack (formerly Video Embed & Thumbnail Generator)
4
  Plugin URI: https://www.wordpressvideopack.com/
5
  Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
6
+ Version: 4.7.2
7
  Author: Kyle Gilman
8
  Author URI: https://www.kylegilman.net/
9
  Text Domain: video-embed-thumbnail-generator
58
  $edit_others_capable = kgvid_check_if_capable('edit_others_posts');
59
 
60
  $options = array(
61
+ "version" => '4.7.2',
62
  "videojs_version" => '7.13.3',
63
  "embed_method" => "Video.js v7",
64
  "template" => false,
1996
  }
1997
 
1998
  if ( $options['embed_method'] == "WordPress Default" ) {
1999
+
2000
  global $wp_version;
2001
 
2002
  if ( $wp_version >= 4.9 ) {
2019
  }
2020
 
2021
  //plugin-related frontend styles, requires video-js
2022
+ if ( $options['embed_method'] != 'None' ) {
2023
+ wp_enqueue_style( 'kgvid_video_styles', plugins_url("/css/kgvid_styles.css", __FILE__), array( 'video-js' ), $options['version'] );
2024
+ }
2025
 
2026
  if ( $options['alwaysloadscripts'] == 'on' ) {
2027
  kgvid_enqueue_shortcode_scripts();
2831
  if ( $query_atts['align'] == "right" ) { $aligncode = ' kgvid_wrapper_auto_left'; }
2832
  }
2833
 
2834
+ if (
2835
+ ( $query_atts['title'] != "false"
2836
  || $query_atts['embedcode'] != "false"
2837
  || $query_atts['downloadlink'] == "true"
2838
  || $options['twitter_button'] == 'on'
2839
+ || $options['facebook_button'] == 'on'
2840
+ )
2841
+ && $options['embed_method'] != 'None'
2842
  ) { //generate content overlaid on video
2843
  $kgvid_meta = true;
2844
  }
2903
  );
2904
  $video_variables = apply_filters('kgvid_video_variables', $video_variables, $query_atts, $encodevideo_info);
2905
 
2906
+ if ( $options['embed_method'] == "Video.js"
2907
+ || $options['embed_method'] == "Video.js v7"
2908
+ || $options['embed_method'] == "None"
2909
+ ) {
2910
 
2911
  $enable_resolutions_plugin = false;
2912
  $x = 20;
3141
  $code .= $executed_shortcode;
3142
  }
3143
 
3144
+ if ( $options['embed_method'] == "Video.js"
3145
+ || $options['embed_method'] == "Video.js v7"
3146
+ || $options['embed_method'] == "None"
3147
+ ) {
3148
 
3149
  $code .= "\n\t\t\t\t".'<video id="video_'.$div_suffix.'" ';
3150
  if ( $query_atts["playsinline"] == 'true' ) { $code .= 'playsinline '; }
3154
  if ( $query_atts["muted"] == 'true' ) { $code .= 'muted '; }
3155
  $code .= 'preload="'.$query_atts['preload'].'" ';
3156
  if ( $query_atts["poster"] != '' ) { $code .= 'poster="'.esc_attr($query_atts["poster"]).'" '; }
3157
+ if ( $options['embed_method'] != "None" ) {
3158
+ $code .= 'width="'.$query_atts["width"].'" height="'.esc_attr($query_atts["height"]).'"';
3159
+ }
3160
+ else {
3161
+ $code .= 'width="100%"';
3162
+ }
3163
+
3164
+ if ( $options['embed_method'] != "None" ) {
3165
+ if ( $options['js_skin'] == "" ) { $options['js_skin'] = "vjs-default-skin"; }
3166
+ if ( is_array($atts) && array_key_exists('skin', $atts) ) {
3167
+ $options['js_skin'] = $atts['skin']; //allows user to set skin for individual videos using the skin="" attribute
3168
+ }
3169
+ $code .= ' class="fitvidsignore '.esc_attr('video-js '.$options['js_skin']).'">'."\n";
3170
+ }
3171
+ else {
3172
+ $code .= ' class="fitvidsignore">'."\n";
3173
  }
 
3174
 
3175
  $code .= implode("", $sources); //add the <source> tags created earlier
3176
  $code .= $track_code; //if there's a text track
3278
  $code .= "</div>\n";
3279
  }
3280
 
3281
+ if ( !empty($query_atts["watermark"])
3282
+ && $query_atts["watermark"] != "false"
3283
+ && $options['embed_method'] != "None"
3284
+ ) {
3285
  $watermark_id = kgvid_url_to_id($query_atts["watermark"]);
3286
  if ( $watermark_id ) { $query_atts["watermark"] = wp_get_attachment_url($watermark_id); }
3287
  if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) {
3355
 
3356
  $src_atts = array('src', 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv');
3357
  foreach ( $src_atts as $src_key ) {
3358
+ if ( is_array($atts) && array_key_exists($src_key, $atts) ) {
3359
  $content = $atts[$src_key];
3360
  break;
3361
  }
4827
 
4828
  $players = array(
4829
  "Video.js v7" => "Video.js v7",
4830
+ "Video.js v5 (" . __("deprecated", 'video-embed-thumbnail-generator') . ")" => "Video.js",
4831
+ __("WordPress Default", 'video-embed-thumbnail-generator') => "WordPress Default",
4832
+ __("None", 'video-embed-thumbnail-generator') => "None"
4833
  );
4834
 
4835
  $players = apply_filters('kgvid_available_video_players', $players);
4839
  $selected = ($options['embed_method']==$value) ? 'selected="selected"' : '';
4840
  echo "<option value='$value' $selected>$name</option>";
4841
  }
4842
+ echo "</select> <span class='kgvid_tooltip wp-ui-text-highlight'><span class='kgvid_tooltip_classic'>".__('Video.js version 7 is the default player. You can also choose the WordPress Default Mediaelement.js player which may already be skinned to match your theme. Selecting "None" will disable all plugin-related CSS and JS on the front end.', 'video-embed-thumbnail-generator')."</span></span></td></tr></tbody></table>\n";
4843
 
4844
  $sampleheight = intval($options['height']) + 50;
4845
  echo "<div class='kgvid_setting_nearvid' style='width:".$options['width']."px;'>";