Loop
|
|
Is it possible to add a loop function to it ? If so whit a button integration like in this script as you can see in the Screen Shots section.
Dany |
|
|
sorry, but what do you mean? To add a loop video option? If you wanted that, I'd have to use the older YouTube player (the ugly one) or one that has a YouTube logo. Either way, its kinda stinky... Request this feature on YousableTubeFix. That has a collection of YouTube fixes. This script is for people who like YouTube's layout, but want HD videos and highest quality without messing things up. |
|
|
Yeah but i see your point. |
|
|
If you want, I can make a separate script for this option that's compatible with this script. You want that? |
|
|
I, for one, would like that! I tried your script together with http://userscripts.org/scripts/show/28832 but the two are not compatible. The loop script only works on normal quality videos anyway, but even when I set them to normal quality with your script, it doesn't loop, leading me to believe the two are not compatible... |
|
|
Loop is implemented (not on-off in page though, must configure with text editor). Hmm.. maybe I should add a GUI for options. |
|
|
Thank you! It would be nice to have an on/off option on the page, yes. |
|
|
The script is brilliant but the loop is annoying. lol
|
|
|
Bumping for a button/text or something on the main page to enable/disable looping. Center of the watch-ratings-views div or over/under "Download this video as" would be nice. :D |
|
|
I for got about this topic reg.
|
|
|
For an on/off option on the page change
handleWatchPagePlayerStateChange=function(state) {
if (state == 0) {
if(loop) {
player.seekTo(0,true);
player.playVideo();
}
if (watchIsPlayingAll) {
gotoNext();
}
}
};
player.addEventListener("onStateChange","handleWatchPagePlayerStateChange");
to handleWatchPagePlayerStateChange=function(state) {
if (state == 0) {
if(loop) {
player.seekTo(0,true);
player.playVideo();
}
else {
player.clearVideo();
if (watchIsPlayingAll) {
gotoNext(); }
}
}
};
player.addEventListener("onStateChange","handleWatchPagePlayerStateChange");
And then add this in the function showDownloads() at the beginning
function toggle_loop(e)
{
if (loop)
{
loop=false;
e.target.firstChild.nodeValue = 'Loop=Off ';
looping();
}
else
{
loop=true;
e.target.firstChild.nodeValue = 'Loop=On ';
looping();
}
}
function looping() {
handleWatchPagePlayerStateChange=function(state) {
if (state == 0) {
if(loop) {
player.seekTo(0,true);
player.playVideo();
}
else {
player.clearVideo();
if (watchIsPlayingAll) {
gotoNext(); }
}
}
};
player.addEventListener("onStateChange","handleWatchPagePlayerStateChange");
}
var link = document.createElement('a');
if (loop)
var text = document.createTextNode('Loop=On ');
else
var text = document.createTextNode('Loop=Off ');
link.appendChild(text);
link.setAttribute("href", "#watch-vid-title");
link.addEventListener("click", toggle_loop, false);
And then add That's how I implemented it. I bet someone will find something wrong/redundant with it, because, well, I can't code in JS, but I gave it a shot and it does work. Can someone make it so that the text colour is red when off and green when on? I don't know how... Edit: playlists now autoplay normally if loop is turned off. |
|
|
The loop function is broken I think. Can someone confirm this? I also tried x0rnn's tweak but I couldn't make it work. |
|
|
Works fine for me. |