google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.75k stars 6.03k forks source link

HLS init segment loads are not reported to MediaSourceEventListener #6130

Open tipoc123 opened 5 years ago

tipoc123 commented 5 years ago

[REQUIRED] Issue description

Exoplayer tries lo load chunk by url /vod/78/video_78.mp4 instead of video_78.mp4?expires=1562330914&md5=4LMrqMnsIj99n8grOu1C3w (as stated in playlist) and as a result gets 403 Forbidden.

Also see the next difference (correct uri in onLoadStarted, incorrect - in DefaultHttpDataSource's open):

07-04 15:48:35.042 D/EventLogger( 4772): onLoadStarted [0.14, 0.00, window=0, period=0, uri=http://mw.iptv/vod/78/video_78.mp4?expires=1562330914&md5=4LMrqMnsIj99n8grOu1C3w, dataSpec.uri=http://mw.iptv/vod/78/video_78.mp4?expires=1562330914&md5=4LMrqMnsIj99n8grOu1C3w]
07-04 15:48:35.066 D/CustomHttpDataSource( 4772): open dataSpec.uri=http://mw.iptv/vod/78/video_78.mp4

[REQUIRED] Reproduction steps

Play content protected by Axinom DRM.

[REQUIRED] Link to test content

Sorry, no publicly available link.

[REQUIRED] A full bug report captured from the device

bugreport.txt

[REQUIRED] Version of ExoPlayer being used

2.10.0

[REQUIRED] Device(s) and version(s) of Android being used

Android 6.0.1 STB GIEC MP1113 (chip Amlogic s905x)

tipoc123 commented 5 years ago

Example playlist (located at http://mw.iptv/vod/78/stream_1.m3u8?expires=1562330914&md5=cQ7YiHghCza6QB8ZZmWQFA):

example_playlist.txt.

Real file extension m3u8

tonihei commented 5 years ago

ExoPlayer is not actually removing any query parts. The load you are seeing is the load for initialization data as specified in the EXT-X-MAP tag:

#EXT-X-MAP:URI="video_78.mp4",BYTERANGE="1128@0"

What's wrong here is that the event listener receives the onLoadStarted for the following media chunk load already, although the initialization data is loaded first. The load for the initialization data doesn't issue any events at all. The most likely fix is to separate the loads for initialization data and media data in a similar way as it's done for DASH.

tipoc123 commented 5 years ago

Thanks! Now it's working.

tonihei commented 5 years ago

Great! I'll keep the issue open to fix the wrong reporting.