From 8b96635fab68579e1e327c80bf3040225cf99ae8 Mon Sep 17 00:00:00 2001 From: Daniel Tome Date: Thu, 13 Aug 2015 09:50:06 +1000 Subject: [PATCH 1/2] Updated the youtube embed so it also works with HTTPS --- js/youmax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/youmax.js b/js/youmax.js index 5e4d62d..6fe29c5 100644 --- a/js/youmax.js +++ b/js/youmax.js @@ -390,7 +390,7 @@ if(youmax_global_options.showVideoInLightbox){ showVideoLightbox(this.id); } else { - $('#youmax-video').attr('src','http://www.youtube.com/embed/'+this.id); + $('#youmax-video').attr('src','//www.youtube.com/embed/'+this.id); $('#youmax-video').show(); $('html,body').animate({scrollTop: $("#youmax-header").offset().top},'slow'); } @@ -512,7 +512,7 @@ showVideoLightbox = function(videoId) { $('#youmax-lightbox').show(); - $('#youmax-video-lightbox').attr('src','http://www.youtube.com/embed/'+videoId); + $('#youmax-video-lightbox').attr('src','//www.youtube.com/embed/'+videoId); $('#youmax-lightbox').click(function(){ $('#youmax-video-lightbox').attr('src',''); From 2f89a2c77fe619224011436f09f4ba569f3c743c Mon Sep 17 00:00:00 2001 From: Daniel Tome Date: Thu, 13 Aug 2015 10:02:28 +1000 Subject: [PATCH 2/2] If a video is made private on a playlist. Then the thumbnail array is missing from the snippet array. This bit of code, just checkst that the thumbnail exists and adds it to the videoIdArray only if it exists. --- js/youmax.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/js/youmax.js b/js/youmax.js index 6fe29c5..c040d24 100644 --- a/js/youmax.js +++ b/js/youmax.js @@ -360,26 +360,30 @@ var uploadsArray = response.items; var videoIdArray = []; - + var idxCounter = 0; + for(var i=0; i
'+secondsToTime(videoDuration)+'
'+videoTitle+'
'+getReadableNumber(videoViewCount)+' views | '+getDateDiff(videoUploaded)+' ago'); - - if((i+youmax_global_options.youmaxItemCount)%youmaxColumns!=0) - $('#youmax-video-list-div').append('
'+videoTitle+'
'+getDateDiff(videoUploaded)+' ago
'); - else - $('#youmax-video-list-div').append('
'+videoTitle+'
'+getDateDiff(videoUploaded)+' ago
'); - + if (typeof uploadsArray[i].snippet.thumbnails != 'undefined') { + idxCounter++; + videoThumbnail = uploadsArray[i].snippet.thumbnails.medium.url; + //videoThumbnail = videoThumbnail.replace("hqdefault","mqdefault"); + + videoIdArray.push(videoId); + + //$('#youmax-video-list-div').append('
'+secondsToTime(videoDuration)+'
'+videoTitle+'
'+getReadableNumber(videoViewCount)+' views | '+getDateDiff(videoUploaded)+' ago
'); + + if((i+youmax_global_options.youmaxItemCount)%youmaxColumns!=0) + $('#youmax-video-list-div').append('
'+videoTitle+'
'+getDateDiff(videoUploaded)+' ago
'); + else + $('#youmax-video-list-div').append('
'+videoTitle+'
'+getDateDiff(videoUploaded)+' ago
'); + + } } youmax_global_options.youmaxItemCount+=uploadsArray.length;