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 +} 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;