Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev link to first page reload the videoplayer #7

Open
ghost opened this issue Nov 19, 2016 · 2 comments
Open

Prev link to first page reload the videoplayer #7

ghost opened this issue Nov 19, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2016

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
Copy link
Author

ghost commented Nov 24, 2016

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 :)

@bachors
Copy link
Owner

bachors commented Nov 24, 2016

Cool @jpp86, your welcome. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant