6 Replies Latest reply: Nov 26, 2014 2:15 PM by Shivam nagar RSS

    player.seek(0) for dvr does not move the scrub bar to start position

    dibs_2011 Community Member

      I am using player.seek(0) whenever onJavaScriptBridgeCreated is invoked and player is ready.

      My stream is of dvr type. Although the seek(0) starts the video from the beginning, the scrub bar is not moving to start position. Any idea how I can do this ?

       

       

      Below is the sample code I am using.

       

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml">

        <head>

          <title>Strobe Media Playback</title>

          <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

                <script type="text/javascript">  

       

       

      var parameters =

                {          src: "http://localhost:1935/dvr/mystream/manifest.f4m?DVR"  

                ,          autoPlay: true

                ,          controlBarAutoHide: false

                ,   javascriptCallbackFunction: "onJavaScriptBridgeCreated"

                };

       

      // Embed the player SWF:    

      swfobject.embedSWF

                ( "StrobeMediaPlayback.swf"

                , "strobeMediaPlayback"

                , 640

                , 480

                , "10.1.0"

                , {}

                , parameters

                , { allowFullScreen: "true",  allowScriptAccess: "always"}

                , { name: "strobeMediaPlayback" }

                );

       

       

                function onJavaScriptBridgeCreated(playerId)

                {

                          if (player == null) {

                                    player = document.getElementById(playerId);

       

       

                                    document.getElementById("go_to_start").onclick = function(){

                                    var state = player.getState();

                                    if (state == "ready" || state == "paused") {

                                              player.seek(0)

                                              player.play2();

                                    }

       

                                    return false;

                                    };

                             }

                }

       

                </script>

       

                <body>

                          <div>

                                    <div>

                                              <span id="currentTime" /> ... </span> : <span id="duration" /> ... </span>

                                    </div>  

                                    <a href="#" id="play-pause">Play/Pause</div> 

                          </div>

                          <div id="strobeMediaPlayback">

                      <p>Alternative content</p>

                    </div>

                  </body>