androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.68k stars 402 forks source link

When loading some HLS videos, the value of duration or currentPosition is displayed/processed incorrectly. #338

Open Kofeins opened 1 year ago

Kofeins commented 1 year ago

Media3 Version

ExoPlayer 2.18.6

Devices that reproduce the issue

Pixel 4 XL API 33 Pixel 6 API 32 Pixel 4 XL API 31 Pixel 4 XL API 29

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

  1. Load HLS video: https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
  2. Rewind to the end of the video

Expected result

The values of Player.currentPosition and Player.duration are equal:

Player.currentPosition = 14:48

Player.duration = 14:48

Actual result

Player.currentPosition exceeds Player.duration and continues to increase until 15:05

On playback finished:

Player.currentPosition = 15:05

Player.duration = 14:48

Bug visualization(currentPosition > duration): Снимок экрана (92)

Media

Test URL = https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8

My demo app using ExoPlayer2 on Google Drive: https://drive.google.com/file/d/1ilhc0UhFpuyEBj5_fu5i9Y4YFqVQBiBx/view?usp=share_link

Bug Report

saket commented 10 months ago

I've seen this happen with MP4 videos as well. Here's one example: https://cdn.masto.host/androiddevsocial/media_attachments/files/110/900/494/975/751/021/original/e01d435e9f334483.mp4

Should ExoPlayerImpl#getCurrentPosition() manually ensure that its value never exceeds getContentDuration()?