Skip to main content
May 15, 2012 10:05 AM UTC
Answered

Get time when play a stream

Hi

I'm using method play() of Stream to play list file. How do I get current time of video playing ? I try Stream.time but it return total time of Stream.

    This topic is closed to new replies. Start a new post to keep the conversation going.
    NpCompleteCorrect answer
    Adobe Employee
    May 15, 2012 11:03 AM UTC

    I think you can process the approx time using watch on

    Stream.onPlayStatus (http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7e42SSASLR.html#WSba58fdee7d6ee05f-3e4c639a126965313a2-8000) which will trigger with NetStream.Play.Switch when stream switches. Find Stream.time at that time ( say startTime of current video).

    Find Stream.time of playlist (say total time).

    Current video play time = total stream time - start time of current video.

    2 replies

    NpCompleteCorrect answer
    Adobe Employee
    May 15, 2012 11:03 AM UTC

    I think you can process the approx time using watch on

    Stream.onPlayStatus (http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7e42SSASLR.html#WSba58fdee7d6ee05f-3e4c639a126965313a2-8000) which will trigger with NetStream.Play.Switch when stream switches. Find Stream.time at that time ( say startTime of current video).

    Find Stream.time of playlist (say total time).

    Current video play time = total stream time - start time of current video.

    Translate
    May 16, 2012 10:56 AM UTC

    Yes, I do it success. thanks you

    Translate