Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live streaming issue when using ExoPlayer version 2.17.0 and above #10065

Closed
tpuserhp opened this issue Mar 14, 2022 · 8 comments
Closed

Live streaming issue when using ExoPlayer version 2.17.0 and above #10065

tpuserhp opened this issue Mar 14, 2022 · 8 comments
Assignees
Labels

Comments

@tpuserhp
Copy link

I can stream a m3u8 link from my app when using ExoPlayer 2.16.1 libraries,. But when using ExoPlayer 2.17.0 or 2.17.1 libraries, I don't see the streaming from my app. I then use the demo app of 2.12.3 version and can see the streaming. for that link. But when using the demo app of 2.17.0, I don't see the streaming. I would appreciate if the support could review and recommend actions that I can take. I will submit the link later. Thanks .

@tpuserhp
Copy link
Author

I have emailed the link to support for testing. Thanks.

@icbaker
Copy link
Collaborator

icbaker commented Mar 14, 2022

Thanks for the link. I tried it with the 2.17.1 demo app and observed that playback never started (player stayed in the buffering state forever). I observed the same behaviour on 2.17.0.

On the 2.16.1 demo app the playback starts successfully.

So something seems to have changed between 2.16.1 and 2.17.0. Over to @christosts to take a closer look at this HLS stream.

@christosts
Copy link
Contributor

I can verify the problem. I'll try to get a fix in next week.

Note to self: The loading thread is blocked on TimestampAdjuster.sharedInitializeOrWait() because the first HlsMediaChunk loaded is not a master timestamp source. In 2.16.1 on the other hand, the first chunk loaded is a master timestamp source. I need to check if a load re-ordering has happened between 2.16.1 and 2.17.1.

@tpuserhp
Copy link
Author

Thanks for the issue investigation and the update!!!

@christosts
Copy link
Contributor

christosts commented Mar 28, 2022

The symptom seems to be related with HLS chunkless preparation which is enabled by default in the 2.17 release. To quickly fix the problem in 2.17, you may instantiate the player with an HLS media source that has chunkless preparation disabled:

HlsMediaSource.Factory factory = 
  new HlsMediaSource.Factory(dataSourceFactory).setAllowChunklessPreparation(false);
ExoPlayer player =  
  new ExoPlayer.Builder(context).setMediaSourceFactory(factory).build();

I still need to check if there is a bug in chunkless preparation or this playlist is incompatible with the feature. I'll update this issue accordingly.

Information on chunkless preparation on this blog post.

@tpuserhp
Copy link
Author

Thank you support for providing the quick fix which works very well . My app is now running release 2.17 with no problem from that playlist. Much appreciated!!

@christosts
Copy link
Contributor

Root-causing the issue: the player fails to load/prepare the playlist in chunkless mode because the playlist contains the CODECS attribute but it is missing the audio codec. The player assumes the video variants are prepared but the audio one is not, and the player gets stuck.

If you have access to the encoding/packaging process, I'd suggest you update how the playlist is created and add the audio codec to CODECS. Then try with chunkless preparation, you might see some improvements in start-up time.

On the ExoPlayer side, we submitted a fix to detect this case and fall back to traditional preparation. The fix will be available on the next ExoPlayer release.

@tpuserhp
Copy link
Author

tpuserhp commented Mar 31, 2022 via email

icbaker pushed a commit to androidx/media that referenced this issue Apr 11, 2022
icbaker pushed a commit that referenced this issue Apr 11, 2022
Issue: #10065

#minor-release

PiperOrigin-RevId: 438281023
@google google locked and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants