Search code examples
androidhttp-live-streaming

Android MediaPlayer HLS change on KitKat 4.4.3


Can anyone shed light on the following problem? The android native mediaplayer seems to now use the PTS (Presentation Time Stamp) values in the transport stream to determine playback in the stream, rather than a simple counter. This behavior appeared to start with the 4.4.3 update. The symptoms of this are as follows:

  • The MediaController displays unhelpful values and no longer is able to be used to skip ahead or move back for streams that do not have PTS reset to zero in the first segment.
  • The MediaPlayer returns incorrect values for the getCurrentPosition() api call. Instead of starting at zero, it seems to use the PTS value, and ends returning multiple hours after only 1 second of playback, for example.

I am wondering if anyone can explain this behavior, or can reference a "feature" from this release of KitKat. The closest filed bug in Android I found is here. The player is used in a VideoView. The same playlists report expected numbers for getCurrentPosition() in earlier 4.4.2.

Thanks


Solution

  • It sounds like you're running into the same problem that a lot of people are having with HLS native video on 4.4.3 and 4.4.4: https://code.google.com/p/android/issues/detail?id=70877.

    I haven't seen the presentation time stamp mentioned yet so it would be very helpful if you could share your findings on the bug ticket.