Skip to main content
Inspiring
April 4, 2011
Answered

how to get total time of streaming flv

  • April 4, 2011
  • 1 reply
  • 899 views

hello using old AS2 code on an fms project.

it seems that both server-side NetStream object and client-side NetStream object do not have a totalTime property.

my goal is to determine when the flv has completed playing ( has reached the end  visually );

so I figured that comparing time to totalTime would work ... but there appears to not be a totalTime.

any suggestions.

thanks,

Shannon

    This topic has been closed for replies.
    Correct answer SE_0208

    Yes - NetStream.Play.Stop followed by NetStream.Buffer.Empty can be equated to video over visually.

    NetStream.Play.Stop you would get only once - when it has played back whole FLV or you are manually stopping the play.

    When you get NetStream.Play.Stop there migth be some data in client's buffer hence you will still see some visual data being played in client, once buffer is empty which is indicated by NetStream.Buffer.Empty your video display should black out.

    Hope this helps.

    1 reply

    Participating Frequently
    April 5, 2011

    Actually i did not get your question clearly, you can conclude end of video visually when you get NetStream.Play.Stop followed by NetStream.Buffer.Empty (in case of VOD) OR NetStream.Play.UnpublishNotify (in case of live)

    dsdsdsdsdAuthor
    Inspiring
    April 5, 2011

    SE_0208, thanks for responding.

    is it fair to say that a Stop is followed by an Empty ONLY WHEN the flv has finished??

    in other words, are there any other situation where a Stop can be followed by an Empty?

    thank,

    Shannon

    SE_0208Correct answer
    Participating Frequently
    April 5, 2011

    Yes - NetStream.Play.Stop followed by NetStream.Buffer.Empty can be equated to video over visually.

    NetStream.Play.Stop you would get only once - when it has played back whole FLV or you are manually stopping the play.

    When you get NetStream.Play.Stop there migth be some data in client's buffer hence you will still see some visual data being played in client, once buffer is empty which is indicated by NetStream.Buffer.Empty your video display should black out.

    Hope this helps.