Skip to content

Commit

Permalink
#456 and other gallery thumbnail fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegilman committed Apr 20, 2020
1 parent ff54061 commit 383f6f4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
10 changes: 9 additions & 1 deletion css/kgvid_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ span.kgvid_facebook_icon_holder {
}

.kgvid_video_gallery_thumb {
position: relative;
position: relative;
max-width:100%;
vertical-align: bottom;
display:inline-block;
cursor: pointer !important;
Expand All @@ -315,6 +316,13 @@ span.kgvid_facebook_icon_holder {
object-fit: cover;
}

.kgvid_video_gallery_thumb .mejs-overlay-button {
position: absolute;
top: 50%;
left: 50%;
transform-origin: 0 0;
}

.kgvid_video_gallery_thumb .titlebackground {
position:absolute;
bottom:10px;
Expand Down
8 changes: 5 additions & 3 deletions js/kgvid_video_embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,12 +934,14 @@ function kgvid_resize_gallery_play_button(gallery_id) {

if ( video_vars.player_type == "Video.js" ) {
var button_selector = '.vjs-big-play-button';
var translate_y = 30;
var translate_x = '0';
var translate_y = '-30px';
}

if ( video_vars.player_type == "WordPressDefault" ) {
var button_selector = '.mejs-overlay-button';
var translate_y = 5;
var translate_x = '-50%'
var translate_y = '-55%';
}

var play_button_percent = jQuery('#'+gallery_id+' '+button_selector).width()/thumb_width;
Expand All @@ -948,7 +950,7 @@ function kgvid_resize_gallery_play_button(gallery_id) {
var scale_value = Math.round(thumb_width * max_percent / unscaled_width * 1000)/1000;

if ( scale_value < 1 ) {
var css_text = 'scale('+scale_value+') translateY(-'+translate_y+'px)';
var css_text = 'scale('+scale_value+') translate('+translate_x+', '+translate_y+')';

jQuery('#'+gallery_id+' '+button_selector).css({
'transform' : css_text,
Expand Down
8 changes: 5 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: kylegilman
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kylegilman@gmail.com&item_name=Video%20Embed%20And%20Thumbnail%20Generator%20Plugin%20Donation
Tags: video, video player, video gallery, video thumbnail, ffmpeg, resolution
Requires at least: 4.4
Tested up to: 5.2
Tested up to: 5.4
Requires PHP: 5.6.0
Stable tag: 4.6.25
License: GPLv2 or later
Expand Down Expand Up @@ -250,12 +250,14 @@ Enter the username & password in the plugin settings "FFMPEG Settings" tab, or u

== Changelog ==

= 4.6.26 - July 6, 2019 =
= 4.6.26 - April 22, 2020 =
* Added option to disable shortcode URL rewriting if WordPress doesn't know your videos are hosted on a CDN.
* Added playsinline attribute to Video.js videos to allow iPhones to play videos inline on web pages.
* Added filter to manually rewrite shortcode URLs.
* Changed code that caused fatal error 'Can't use function return value in write context' on PHP versions before 5.5
* Stopped using deprecated $user_ID global
* Made gallery thumbnail images responsive.
* Stopped using deprecated $user_ID global.
* Fixed bug that crashed WordPress Default player if text tracks were available but no default track was set.

= 4.6.25 - May 28, 2019 =
* Fixed bug that broke pop-up galleries when video title had a space in the name.
Expand Down
1 change: 0 additions & 1 deletion video-embed-thumbnail-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3462,7 +3462,6 @@ function KGVID_shortcode($atts, $content = '') {
if ( $query_atts['align'] == "left" ) { $aligncode = ' kgvid_textalign_left'; }
if ( $query_atts['align'] == "center" ) { $aligncode = ' kgvid_textalign_center'; }
if ( $query_atts['align'] == "right" ) { $aligncode = ' kgvid_textalign_right'; }
if ( $query_atts['inline'] == "true" ) { $aligncode .= ' kgvid_wrapper_inline'; }

$code .= '<div class="kgvid_gallerywrapper'.$aligncode.'" id="kgvid_gallery_'.$kgvid_gallery_id.'" data-query_atts="'.esc_attr(json_encode($gallery_query_atts)).'">';
$code .= kgvid_gallery_page(1, $gallery_query_atts);
Expand Down

0 comments on commit 383f6f4

Please sign in to comment.