1

I'm using a NetStream class to play video using Video class or stage video , there is no seek bar to backward or forward video , i add seek bar to video but the seek function not work exactly , it give me a wrong time of seeking . ns.seek(mySeekTime) i wondered if it possible to make my own seek bar with exact seeking , i get the video from server , is server affect on seeking for video ?

        private function onClick(event:MouseEvent):void
        {
             if (event.currentTarget is Group)
             {
                 var myGroup:Group = event.currentTarget as Group;
                 if ( myGroup.mouseX >= 100)
                  {
                     mouseClickedXPos = myGroup.mouseX;
                     ns.inBufferSeek = true;
                     var seekTime:Number = (mouseClickedXPos-100) * (totalTime/(controlBarControls.width-100));
                     ns.seek(seekTime);     
                     myRect.graphics.clear();
                     myRect.graphics.beginFill(0xFF0000);
                     myRect.graphics.drawRect(controlBarControls.x+100,controlBarControls.y,mouseClickedXPos-100, rect.height);
                 }  
             }
        }

Here seek bar is myRect shape i draw it after Event.ENTER_FRAME .

problem : the time ns.time() will not change to new time we updated by seek(seekTime)

Sameer H. Ibra
  • 1,816
  • 2
  • 17
  • 25

1 Answers1

0

Did you try to add keyframes to the video in ex. Adobe Media Encoder? It seems that seek function uses keyframes to locate the time.

kosmo
  • 175
  • 2
  • 13
  • NetStream can only seek to keyframes. If you have keyframes every six seconds and then seek to time 10 the video will end up playing at time 6. – Nathan Jun 17 '13 at 19:46