Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Links to timeline?

5 replies [Last post]

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

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

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>

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

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.