Skip to main content
March 25, 2010
Question

resume() not working

  • March 25, 2010
  • 2 replies
  • 792 views

Hi everyone,

I couldnt find an answer to my problem anywhere, i hope some of you can help me out.

I am trying to play a previously recorded video, everything works fine except the resume() method (same with togglePause() - when it's used to resume the video - the pause works just fine)

Here's a bit of my code:

this.customClient = new Object();
this.customClient.onMetaData = metaDataHandler;

this.nsPlay = new NetStream(this.nc);
this.nsPlay.bufferTime = 2;
this.nsPlay.addEventListener(NetStatusEvent.NET_STATUS, onPlaybackStatus);
this.nsPlay.client = this.customClient;
this.videoRemote.attachNetStream(this.nsPlay);
this.nsPlay.play(this.MOVIE_NAME, 0);

/** play/pause button click handler **/

private function onPlayPause(evt:MouseEvent):void
{
               this.nsPlay.togglePause();

}

Any help or tip would be greatly appreciated.

    This topic has been closed for replies.

    2 replies

    March 25, 2010

    after more testing, i found out the problem lied in overwriting recorded videos. There was some XML being created for each recorded video which apparently was causing problems (i'm not sure what exactly, i dont have much server knowledge).

    i settled on a solution based on recording videos with different names each time instead of overwriting the same video (and when the user settles for a final video, will delete all previous videos).

    Thanks for all the help that helped me find where the problem lied, Janaki!

    Janaki Lakshmikanthan
    Adobe Employee
    Adobe Employee
    March 25, 2010

    Hi,

    I hope you are on flash player version greater than 9. You haven't mentioned the exact problem what you are observing when you hit that button or when 'onPlayPause' method is called?

    Regards,

    Janaki L

    March 25, 2010

    Hi Janaki,

    Thanks for the reply. i am using flash 10 and this is what i get from netStatus when i hit the button (i have to mention that the video starts playing automatically, so the first button click is a pause)

    first click:

    NetStream.Pause.Notify
    NetStream.Pause.Notify
    NetStream.Buffer.Flush

    second click:
    NetStream.Unpause.Notify
    NetStream.Unpause.Notify
    NetStream.Play.Start


    Now, although it says "NetStream.Play.Start" and theoretically it _should_ play, the video is frozen and would not play again (no matter how many times i click the button).

    I also don't know why i get the Pause/Unpause events twice.

    ----


    As a sidenote, i also have a "stop" button that does the following:

    this.nsPlay.pause();
    this.nsPlay.seek(0);

    When i click this button, then use the "play/pause" button again multiple times, the togglePause() works fine for the first 3 times (i am getting it to resume() once, but just ONCE, any other attempts are getting me in the same freeze situations as before using the "stop" button).


    Any idea what can be wrong?
    Janaki Lakshmikanthan
    Adobe Employee
    Adobe Employee
    March 25, 2010

    Getting pause message twice is wierd. Can you share whole of your application?

    It will help me to debug this issue. We might be issuing another from code as well.  need to nail down that. you can send the code to me at jlakshmi@adobe.com.

    Regards,

    Janaki L