Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
Btw avg, I like the old player because you can click anywhere on the player to start it... the new one you have to click right on the button. Also I like the seeking more on the old one, it seems more precise. |
|
|
testing it seems to work, but the "greenish" css is completely gone. |
|
|
@avg - Thanks, that works really well. I've updated the script with your code. BTW, do you know why < blockquote > doesn't seem to be working in comments anymore? |
|
|
Even shorter code is: USES THE PLAYER ON THE PAGE
with(document.getElementById('movie_player'))
{
setAttribute("flashvars","autoplay=0&"+getAttribute("flashvars"));
src+="#";
}
this allows you to use the new player as well, instead of switching to the less attractive older one. |
|
|
Ok I tested this code and it works fine: USES THE OLD PLAYER
with(document.getElementById('movie_player'))
{
src="/player2.swf?"+getAttribute("flashvars");
setAttribute("flashvars","iurl=http%3A//img.youtube.com/vi/"+/v=([^#&]+)/.exec(document.URL)[1]+"/default.jpg");
src+="#";
}
|
|
|
did you try out my other code suggestion? i tried it and it works on this end. |
|
|
I tried it out but it didn't seem to work for me. |
|
|
This script can be shorter: var $=function(x) {return document.getElementById(x)},
fvars = $('movie_player').getAttribute('flashvars'),
getArg=function(arg) {
return (new RegExp(arg+"=([^&#]+)").exec(fvars)||[,''])[1];
},
vidID = getArg('video_id'), l=getArg('l'), t = getArg('t');
$((/\/user\//.test(document.URL) ? 'profile' : 'watch') + '-player-div').innerHTML = '<embed id="movie_player" flashvars="&rs=1&sn=1&hl=en&iurl=http%3A//img.youtube.com/vi/'+vidID+'/default.jpg"'+
'type="application/x-shockwave-flash" wmode="transparent" src="/player2.swf?video_id='+vidID+'&t='+t+'&l='+l+'"'+
'height="395px" width="480px"></embed>';
Haven't tested it at all, but I'm assuming it should work. But one question: Why don't you just port the flashvars directly over, instead of extracting bits and pieces? Better yet, why don't you just search for the For example, wouldn't :
document.getElementById('movie_player').src='/player2.swf'
do the trick? I might be wrong. |
|
|
@ekbworldwide & wolssiloa - I've updated it to work on the profile page. |
|
|
I second ekbworldwide's idea. Videos on a user's profile should also not automatically play. |
|
|
Could you add the ability to stop profile videos from auto-starting? |
|
|
Nice. Could you possibly make a script that will just pause the video when it starts, so it loads but doesn't play right away? In other words, could you make this script have the video load but not play yet? |
|
|
Very helpful script indeed! Thanks a lot, mate! |
|
|
this script doesn't work with opera 9.51 |
|
|
Awesome script, very useful. Thanks Yansky! |
|
|
Updated |
|
|
thank you work great... |
|
|
@Daniel Silva: Try this script instead: http://userscripts.org/scripts/show/13955 |
|
|
Hi, developers. I would like to make a suggestion about YT Prevent Autoplay: When this feature is marked/enabled, the Prevent Autoplay works fine, but I will be thankful if the video continues loading automatically, like paused or something... Free Hugs,
|
|
|
@spacemanspiff: I've altered the script so it wont open in a new window when you click on the big arrow in the middle of the video to play it. The script should also work now even if embedding is disabled. |
|
|
hi yansky, it's a great script here
not a huge problem, but still a bit of an annoyance any way to fix that? |
|
|
An alternative to my script is this one by lazyttrick: http://userscripts.org/scripts/show/7917 |
|
|
Yeah, thank you Yansky. |
|
|
Bisley, I think it should be ok now. |