Video Embed & Thumbnail Generator - Version 4.5.1

Version Description

This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the support forum.

Download this release

Release Info

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

Code changes from version 4.5 to 4.5.1

Files changed (2) hide show
  1. readme.txt +9 -1
  2. video-embed-thumbnail-generator.php +30 -7
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kyleg
4
Tags: video, video player, video gallery, html5, shortcode, thumbnail, video thumbnail, preview, poster, ffmpeg, libav, embed, oembed, mobile, webm, ogg, h.264, h264, vp9, responsive, mp4, jwplayer, resolution
5
Requires at least: 3.5
6
Tested up to: 4.3
7
- Stable tag: 4.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -229,6 +229,11 @@ Enter the username & password in the plugin settings "FFMPEG Settings" tab, or u
229
230
== Changelog ==
231
232
= 4.5 - July 7, 2015 =
233
* This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the <a href="https://wordpress.org/support/plugin/video-embed-thumbnail-generator">support forum</a>.
234
* Consolidated most video metadata database entries into a single array. This might slow things down the first time you load the Media Library.
@@ -705,6 +710,9 @@ Enter the username & password in the plugin settings "FFMPEG Settings" tab, or u
705
706
== Upgrade Notice ==
707
708
= 4.5 =
709
This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the support forum.
710
4
Tags: video, video player, video gallery, html5, shortcode, thumbnail, video thumbnail, preview, poster, ffmpeg, libav, embed, oembed, mobile, webm, ogg, h.264, h264, vp9, responsive, mp4, jwplayer, resolution
5
Requires at least: 3.5
6
Tested up to: 4.3
7
+ Stable tag: 4.5.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
229
230
== Changelog ==
231
232
+ = 4.5.1 - July 9, 2015 =
233
+ * Fixed bug that accidentally deleted thumbnail image IDs from video meta when editing attachments.
234
+ * Prevented automatic re-writing of video URLs to a local address if a popular cloud storage address is entered in the shortcode (Amazon AWS, Rackspace, etc).
235
+ * Restored full-resolution thumbnails when width is set to a percentage.
236
+
237
= 4.5 - July 7, 2015 =
238
* This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the <a href="https://wordpress.org/support/plugin/video-embed-thumbnail-generator">support forum</a>.
239
* Consolidated most video metadata database entries into a single array. This might slow things down the first time you load the Media Library.
710
711
== Upgrade Notice ==
712
713
+ = 4.5.1 =
714
+ This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the support forum.
715
+
716
= 4.5 =
717
This is probably the last completely free major release. Some advanced features will be converted to premium add-ons in the future. More info in the support forum.
718
video-embed-thumbnail-generator.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Video Embed & Thumbnail Generator
4
Plugin URI: http://www.kylegilman.net/2011/01/18/video-embed-thumbnail-generator-wordpress-plugin/
5
Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
6
- Version: 4.5
7
Author: Kyle Gilman
8
Author URI: http://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.5,
62
"embed_method" => "Video.js",
63
"jw_player_id" => "",
64
"template" => false,
@@ -1979,8 +1979,16 @@ function KGVID_shortcode($atts, $content = ''){
1979
1980
if ( !empty($id) ) { //if the video is an attachment in the WordPress db
1981
1982
- $content = wp_get_attachment_url($id);
1983
- if ( $content == false ) { echo "Invalid video ID"; continue; }
1984
1985
$encodevideo_info = kgvid_encodevideo_info($content, $id);
1986
$attachment_info = get_post( $id );
@@ -1997,7 +2005,7 @@ function KGVID_shortcode($atts, $content = ''){
1997
if ( !empty($poster_id) ) {
1998
$poster_image_src = wp_get_attachment_image_src($poster_id, 'full');
1999
$query_atts['poster'] = $poster_image_src[0];
2000
- if ( intval($query_atts['width']) <= get_option('medium_size_h') ) {
2001
$query_atts['poster'] = kgvid_get_attachment_medium_url($poster_id);
2002
}
2003
}
@@ -5259,11 +5267,26 @@ function kgvid_video_attachment_fields_to_save($post, $attachment) {
5259
update_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', $thumb_id);
5260
}
5261
}
5262
- else {
5263
delete_post_meta($post['ID'], '_kgflashmediaplayer-poster');
5264
delete_post_meta($post['ID'], '_kgflashmediaplayer-poster-id');
5265
}
5266
- update_post_meta($post['ID'], '_kgflashmediaplayer-poster', $thumb_url);
5267
}
5268
5269
if( isset($attachment['kgflashmediaplayer-featured']) ) {
3
Plugin Name: Video Embed & Thumbnail Generator
4
Plugin URI: http://www.kylegilman.net/2011/01/18/video-embed-thumbnail-generator-wordpress-plugin/
5
Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
6
+ Version: 4.5.1
7
Author: Kyle Gilman
8
Author URI: http://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.501,
62
"embed_method" => "Video.js",
63
"jw_player_id" => "",
64
"template" => false,
1979
1980
if ( !empty($id) ) { //if the video is an attachment in the WordPress db
1981
1982
+ $attachment_url = wp_get_attachment_url($id);
1983
+ if ( $attachment_url == false ) { echo "Invalid video ID"; continue; }
1984
+ $exempt_cdns = array('amazonaws.com', 'rackspace.com', 'netdna-cdn.com', 'nexcess-cdn.net', 'limelight.com'); //don't replace URLs that point to CDNs
1985
+ $exempt_url = false;
1986
+ foreach ( $exempt_cdns as $exempt_cdn ) {
1987
+ if ( strpos($content, $exempt_cdn) !== false ) {
1988
+ $exempt_url = true;
1989
+ }
1990
+ }
1991
+ if ( !$exempt_url ) { $content = $attachment_url; }
1992
1993
$encodevideo_info = kgvid_encodevideo_info($content, $id);
1994
$attachment_info = get_post( $id );
2005
if ( !empty($poster_id) ) {
2006
$poster_image_src = wp_get_attachment_image_src($poster_id, 'full');
2007
$query_atts['poster'] = $poster_image_src[0];
2008
+ if ( strpos($query_atts['width'], '%') === false && intval($query_atts['width']) <= get_option('medium_size_h') ) {
2009
$query_atts['poster'] = kgvid_get_attachment_medium_url($poster_id);
2010
}
2011
}
5267
update_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', $thumb_id);
5268
}
5269
}
5270
+
5271
+ if ( empty($thumb_url) ) {
5272
delete_post_meta($post['ID'], '_kgflashmediaplayer-poster');
5273
delete_post_meta($post['ID'], '_kgflashmediaplayer-poster-id');
5274
+ delete_post_thumbnail($post['ID']);
5275
+ }
5276
+ else {
5277
+
5278
+ update_post_meta($post['ID'], '_kgflashmediaplayer-poster', $thumb_url);
5279
+
5280
+ if ( empty($thumb_id) ) { //we're not saving a new thumbnail
5281
+ $poster_id = get_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', true);
5282
+ if ( empty($poster_id) ) { //the poster_id meta was accidentally deleted
5283
+ $thumb_url_id = kgvid_url_to_id($thumb_url);
5284
+ if ( $thumb_url_id ) { update_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', $thumb_url_id); }
5285
+ }
5286
+ }
5287
+
5288
}
5289
+
5290
}
5291
5292
if( isset($attachment['kgflashmediaplayer-featured']) ) {