May. 28, 2009Brian
Hello all.
Great player. Thanks!
Are there any examples of how to..
have a link (onlclick event) jump to time-line in the flv?
I have an hour long flv that I would like to have links to jump to certain places on the time-line.
Either xml formatted, javascript event etc.
ie.
Link "Intro" - Jumps to 00.00
Link "Question 1" - jumps to 09.54
Link "Question 2" - Jumps to 35.54
etc etc etc
Maybe there are some docs on this i've missed?
Thanks for any help.
B
May. 28, 2009BaP
http://www.longtailvideo.com/support/forum/JavaScript-Interaction/17398/Continued-sendEvent-issue#msg117405
http://www.longtailvideo.com/support/forum/JavaScript-Interaction/14622/-SEEK-not-working#msg99618
More: http://www.longtailvideo.com/jw/?search=onclick%3D%22player.sendEvent%28%27SEEK%27
Jun. 15, 2009Brian
Thanks so much, I asked the question too soon as usual...
One thing i can't figure out, is am I able to link to Seek points in an external link?
Like, from this forum.. can I have a link like....
www.mysite.com/movie.html?seek=430 - point to a seek point in my flv?
THANK you for any reply.
Awesome player. As soon as I can figure the external link issue, i'll buy for sure.
all the best
Brian
Jun. 15, 2009otherUser
Dump this in the head element fo your HTML
<script type="text/javascript">
//...initialize global variables
var player = null;
var playlist = null;
var seek = true;
//...get the seek position from the query parameters
if(!(seek = swfobject.getQueryParamValue('seek')))
{
//...default seek position
seek = 0;
}
//...the player will call this function when it is done instantiating (however, the playlist may still be loading...)
function playerReady(obj)
{
player = gid(obj.id);
addListeners();
};
//...loop until we get a valid playlist so we know that the player is really ready, then add the TIME Listener
function addListeners()
{
try
{
playlist = player.getPlaylist();
}
catch(e)
{
setTimeout("addListeners();", 100);
}
player.addModelListener('TIME', 'timeMonitor');
};
//...seek to the desired position once the player has started playing (position > 0)
function timeMonitor(obj)
{
if((obj.position > 0) && (seek !== null))
{
seek = null;
player.sendEvent('SEEK', seek);
}
};
//...utility function
function gid(name)
{
return document.getElementById(name);
};
</script>
Jun. 15, 2009Brian
Thanks for the quick reply.
So how do I go about adding the reference to my link?
"http://www.look.com/movie.html?seek=1580"
Am i close? Trying a few different var's but no luck yet.
thanks
B
Jun. 15, 2009otherUser
http://www.look.com/movie.html?seek=1580 is all you need.
you are testing online, correct? the JavaScript API only works online.
you aren't using embed code, are you? the embed code dowsn't enable the JavaScript API.
autostart=true
you are using some type of streaming server, aren't you? seeking into the non-downloaded portion of a video file requires serverside support for streaming.
Here are some helpful links to learn more about the JW Player™:
Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!
If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.