jQuery-Youtube-Channels-Playlist icon indicating copy to clipboard operation
jQuery-Youtube-Channels-Playlist copied to clipboard

Prev link to first page reload the videoplayer

Open ghost opened this issue 9 years ago • 2 comments

Hi, congratulations for your great project!

Sorry for my english, I saw that every time I went to the first "Videos page" with the "Prev" button, the videoplayer reloads itself. This don't happen in other videos pages.

Thanks in advance

ghost avatar Nov 19 '16 06:11 ghost

Ok, I solved the problem adding a var.

$.fn.ycp = function(m, n, p, o) { var isPlaying = false; ... }

then in the ycp_list:

if ((c.prevPageToken == null || c.prevPageToken == undefined) && !isPlaying) {

and at the end of this if:

$(l + ' .ycp div#ycp_youtube_channels' + k + ' div.play:eq(0)').addClass('vid-active'); isPlaying = true;

So now, when I return to the first page the player doesn't reload to play the first video, but continues to play the current video.


EXTRA:

In ycp_part function I've added an extra IF to add a zero if the detik is lesser than 10, so I get 4:05 min instead of 4:5 min

if (dataw[1] != '') { detik = dataw[1].replace('S', ''); if (detik < 10) detik = "0"+detik; }

I hope this can be useful for someone.

Bye and thanks again for your project :)

ghost avatar Nov 24 '16 09:11 ghost

Cool @jpp86, your welcome. 👍

bachors avatar Nov 24 '16 10:11 bachors