There is the youtube jsapi that you can use to access the current play time
via javascript, and also make the player that's already playing jump to a
certain time (or load up at a certain time via flashvars).  The way to
access these properties/functions is tricky since you must use unsafe window
to do it.  http://code.google.com/apis/youtube/js_api_reference.html

//in GM userscript
document.getElementById('movie_player").wrappedJSObject.getCurrentTime();

I think you will experience greater trouble accessing when your internet
connection goes down and goes back up again and what type of connection it
is, unless you were developing an extension instead of a userscript.  It
seems like you would need some sort of dll or pre-existing extension to help
you detect such state changes as Mobil broadband or cable unplugged unless
you were to constantly run some sort of bandwidth test which is not a good
solution.

It would be easier to detect if the player is lagging and to change
automatically, since there is a flashvar to jump to a certain second when
the player loads, and you can tell when the player isn't paused or stopped
but the progress reported isn't advancing at an acceptable rate.  I like the
idea.... although it won't help as far as increasing the quality when you
move to a better connection.

On Mon, May 17, 2010 at 7:26 PM, John Plsek <[email protected]> wrote:

> These may help
>
> How to start at specific time, OBJECT/EMBED
>
> http://www.mydigitallife.info/2008/10/14/youtube-allows-you-to-start-playing-embed-video-at-specific-start-time/
>
> How to start at specific time, using URL
> http://www.ditii.com/2008/10/27/start-a-youtube-video-at-a-specific-time/
>
> How to code this in GM ... well ... that's up to you ;)
>
> Regards
>
> On 18 May 2010 01:56, jyothi panidarapu <[email protected]>wrote:
>
>> Hi,
>>
>> Is it possible to write a javascript to control the youtube video?
>> Here are my requirements, let's say I am watching one video on youtube and
>> it played for 20 seconds.
>> Suppose my connection (wired) went off and I have connected to another
>> network (mobile broadband), now I will get the same video but the lighter
>> version of it (let's mobile version).
>> So now the player should start from 20 seconds. Can this be done using
>> javascript. I will manually give the mobile version url in the browser only
>> the javascript has to do is, It has remember the last video's played time
>> and when I start with the new one it has to start playing from there.
>>
>> Please let me know if anyone has written some script related to this, at
>> least I will get some idea.
>>
>>
>> Thanks
>> - Jyothi
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "greasemonkey-users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<greasemonkey-users%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/greasemonkey-users?hl=en.
>>
>
>
>
> --
> Coming soon - BravoStudio, a complete internet radio/tv solution
>
>  --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<greasemonkey-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to