3 Replies Latest reply on Mar 25, 2013 5:11 AM by ignatev_me

    Seek before play and incorrect time reporting

    dankehl Level 1

      I've been using OSMF to implement HLS streaming in my video player, and I've come across an issue that seems to be a bug.

       

      Basically, I'm using a MediaPlayer object with an F4MElement. I wait for the PLAY and SEEK traits to be available, and then play the media.

      Using this method works fine, and subsequent seek operations also work correctly. The time I get will be the current time of the total.

      For example when I play a 60 second long video for a second or two and then seek to 30 seconds in, the video will play from 30 seconds in and the currentTime of the media player will correctly report 30 as the currentTime and 60 as the duration

       

      However, if I perform a seek *before* playing the video or before some undetermined time has passed(simulating playing from the stream an offset in), then play, while the video will correctly play from the seek point, it will report the current time incorrectly. Specifically, it will report it as if the seek point is the 0 point of the media.

      For example, when I load a 60 second long video and seek to 30 seconds in, then play, the video will play from 30 seconds in, but the currentTime of the media player will incorrectly report 0 as the currentTime(60 is correctly reported as the duration).

       

      What seems to be happening is that the currentTime is being reported as an offset from when the first play operation was started, but it should be an offset from the beginning of the stream. Is there any way to fix this?