[REQ] add loop settings under player
|
|
Hi!
Thanks. |
|
|
Add:
var link = document.createElement('a'),
font = document.createElement('font');
if(opts.loop) {
var text = document.createTextNode('Loop=On');
font.setAttribute('color', '#008000');
}
else {
var text = document.createTextNode('Loop=Off');
font.setAttribute('color', '#ff0000');
}
font.appendChild(text);
link.appendChild(font);
link.setAttribute("href", "javascript:void(0)");
link.setAttribute("onclick", "document.getElementById('watch-vid-title').scrollIntoView(true)");
link.addEventListener("click", toggle_loop, false);
function toggle_loop(e)
{
if (opts.loop)
{
opts.loop=false;
e.target.firstChild.nodeValue = 'Loop=Off';
font.setAttribute('color', '#ff0000');
}
else
{
opts.loop=true;
e.target.firstChild.nodeValue = 'Loop=On';
font.setAttribute('color', '#008000');
}
}
before Also, if you change: if (state == 0) {
if (unsafeWindow.watchIsPlayingAll) {
unsafeWindow.gotoNext();
} else if(opts.loop) {
player.seekTo(0, true);
player.playVideo();
}
return;
}
to if (state == 0) {
if (opts.loop) {
player.seekTo(0, true);
player.playVideo();
}
else {
player.clearVideo();
if (unsafeWindow.watchIsPlayingAll) {
unsafeWindow.gotoNext();
}
}
return;
}
You'll loop a video in a playlist even if you have clicked "Play All" which automatically goes to the next video in a playlist when one finishes. I forget to click on "Stop Autoplaying" sometimes and even though I chose to loop the current video, it goes to the next one when it finishes. |