Welcome, Guest
  • Author Topic: Cue point event executes even after the flv is paused  (Read 2938 times)

    Govinda

    • Mods
    • Systems Administrator
    • *****
    • Posts: 510
    • If You Want To Be Big Then Solve Big Problems
      • View Profile
      • Mitr Learning & Media
      • Email
    I have created a player that loads video FLV files and plays them in a sequence. On loading the videos I retrieve the total video time by stream.client.onMetaData = ns_onMetaData;” and in an EnterFrame event I check whether the video playtime is equal the totaltime. If the video playtime is equal to the totaltime then the player loads the next video. Sometime, even if the video ends, the playtime and total time doesn’t match. So to fix the issue, I decided to put an event cue point (END) at end of each video FLV. So whenever the FLV fires the END event, the player removes the current video and loads the next one.

    Suppose the video total time is 44:00. The cue point is also at 44:00 in the FLV. So whenever the player gets the END event from the FLV then it loads the next one. Now the issue is, if I pause the video at 42:00 and wait for 2 sec, the player gets the END cue point and jumps to the next video. When I paused the video the timer says “42:00 of 44:00”. The timer doesn’t increase, that means the video has actually paused. But I still don’t understand that why I’m getting the END cue point where the video has not reached the time. Any suggestion??
    .: Govinda :.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Is the cuepoint inside the flv or you add it vía actionscript?

    Jorge

    Govinda

    • Mods
    • Systems Administrator
    • *****
    • Posts: 510
    • If You Want To Be Big Then Solve Big Problems
      • View Profile
      • Mitr Learning & Media
      • Email
    Its inside the FLV.
    .: Govinda :.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Hey Govinda, sorry to come later to your question, I was on vacation and specially my brain doesn't cooperate.
    I hope you solve this, sounds like the Timer didn't stop, since if the cuepoint is in the FLV embeded at encoding time, I never get this weird result (but with those that comes from ActionScript, that means added at runtime)
    Did you solve the issue?

    Jorge

    Govinda

    • Mods
    • Systems Administrator
    • *****
    • Posts: 510
    • If You Want To Be Big Then Solve Big Problems
      • View Profile
      • Mitr Learning & Media
      • Email
    Yes Jorge, I solved it :)

    I was writing this code to know that the video has stopped. So somewhere I found that if I add NetStatusEvent.NET_STATUS event, I'll get NetStream.Play.Stop in event.info.code.

    After a long time I've returned to flash-db and I'm really happy to see you very active as always :)
    .: Govinda :.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Yep, that's right, but keep an eye on this: NetStream.Play.Stop also fires when buffers empty and playback stop because there's no enought data, something very common when connection is weak. To difference between a stop in the end and a stop because buffers empty, is an NetStream.Buffer.Flush that fires before the real end

    Jorge

    Govinda

    • Mods
    • Systems Administrator
    • *****
    • Posts: 510
    • If You Want To Be Big Then Solve Big Problems
      • View Profile
      • Mitr Learning & Media
      • Email
    WOW :)

    Thats a great solution. NetStream.Buffer.Flush is much better.
    .: Govinda :.