From 5dddb014b477be64d5c7ee8d8364c8f57dc57187 Mon Sep 17 00:00:00 2001 From: lucianot54 Date: Tue, 3 Nov 2015 20:38:34 +0100 Subject: [PATCH 1/2] Update pgwslideshow.js with video support Add video support with "" in tag
  • --- pgwslideshow.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pgwslideshow.js b/pgwslideshow.js index b0a6281..0b19579 100644 --- a/pgwslideshow.js +++ b/pgwslideshow.js @@ -85,7 +85,6 @@ // Update the current height var updateHeight = function(height, animate) { - // Check maxHeight if (pgwSlideshow.config.maxHeight) { if (height + pgwSlideshow.plugin.find('.ps-list').height() > pgwSlideshow.config.maxHeight) { @@ -224,6 +223,8 @@ currentElement.html('' + (element.title ? element.title : '') + ''); } else if (element.thumbnail) { currentElement.html('' + (element.title ? element.title : '') + ''); + } else if (element.video) { + currentElement.html(''); } if (element.link) { @@ -307,6 +308,11 @@ element.image = elementImage; } + var elementVideo = obj.find('video source').attr('src'); + if ((typeof elementVideo != 'undefined') && (elementImage != '')) { + element.video = elementVideo; + } + // Get title var elementTitle = obj.find('img').attr('alt'); if ((typeof elementTitle != 'undefined') && (elementTitle != '')) { @@ -375,7 +381,13 @@ } // Set the container height - var maxHeight = pgwSlideshow.plugin.find('.ps-current .elt_' + element.id + ' img').height(); + var maxHeight; + if(element.video){ + maxHeight = pgwSlideshow.plugin.find('.ps-current .elt_' + element.id + ' video').height(); + maxHeight += 15; + }else{ + maxHeight = pgwSlideshow.plugin.find('.ps-current .elt_' + element.id + ' img').height(); + } updateHeight(maxHeight, true); return true; From e79bdef1e91ceb52aec65250ebfca6ca2ecaec82 Mon Sep 17 00:00:00 2001 From: lucianot54 Date: Tue, 3 Nov 2015 20:41:14 +0100 Subject: [PATCH 2/2] Update pgwslideshow.css with video support Resize videos like images --- pgwslideshow.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgwslideshow.css b/pgwslideshow.css index 9aa4249..f6b1cbb 100644 --- a/pgwslideshow.css +++ b/pgwslideshow.css @@ -84,7 +84,8 @@ filter: alpha(opacity=60); } -.pgwSlideshow .ps-list li img { +.pgwSlideshow .ps-list li img, +.pgwSlideshow .ps-list li video { display: block; border: 1px solid #777; width: 80px; @@ -207,4 +208,4 @@ .pgwSlideshow.narrow .ps-caption { font-size: 0.8rem; padding: 8px; -} \ No newline at end of file +}