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

The player hangs under certain circumstances #1571

Closed
1 task
821938089 opened this issue Jul 30, 2024 · 6 comments
Closed
1 task

The player hangs under certain circumstances #1571

821938089 opened this issue Jul 30, 2024 · 6 comments
Assignees
Labels

Comments

@821938089
Copy link

821938089 commented Jul 30, 2024

Version

Media3 1.4.0

More version details

No response

Devices that reproduce the issue

Redmi k60 Android 14

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Adds two mediaitem to exoplayer, one of which is less than the minimum buffer length and the other needs to fail to load.
In practice there are more mediaitem behind it, and for the sake of reproducing the problem, two is enough.

Expected result

play the first mediaitem, failed on the second

Actual result

playback hang in buffering state, not play anything

Media

[removed]

Bug Report

@debz-eight
Copy link

As far as I remember, if there is a player error after the media item failed to load and is in buffering state for too long, you can capture the error inside onPlayerError(). I have handled this case manually based on my requirements.

@821938089
Copy link
Author

@debz-eight
In my case, the player doesn't call onPlayerError because the mediaitem that failed to load hasn't started playing yet.

@tianyif tianyif self-assigned this Jul 30, 2024
@debz-eight
Copy link

@debz-eight In my case, the player doesn't call onPlayerError because the mediaitem that failed to load hasn't started playing yet.

If mediaItem has failed to load, then is it giving source error. Can you share any links for the files you are trying to create media item with, so that I can try to replicate with same. I tried with m3u8 files from my side. I used controller.setMediaItems() and set a MutableList of 5 MediaItems.

@821938089
Copy link
Author

@debz-eight I have attached the media files to the issue so you can download them directly.

@tianyif
Copy link
Contributor

tianyif commented Aug 13, 2024

@821938089

Thanks for reporting! I could reproduce this issue from my end. I think your theory is right, the first item is shorter than the minimum buffer length for playback, but the buffer length will not increase as the second item fails to load, thus the ExoPlayerImplInternal will never decide to transition to READY_STATE to play the first item.

Will work on a fix for this.

copybara-service bot pushed a commit that referenced this issue Aug 21, 2024
It is possible for playback to be stuck when there is failure in loading further data, while the player is required to load more due to the buffered duration being under `DefaultLoadControl.bufferForPlayback`. Therefore, we check if there is any loading error in `isLoadingPossible`, so that the player will allow the playback of the existing data rather than waiting forever for the data that can never be loaded.

Issue: #1571
#cherrypick
PiperOrigin-RevId: 665801674
tianyif added a commit that referenced this issue Aug 22, 2024
It is possible for playback to be stuck when there is failure in loading further data, while the player is required to load more due to the buffered duration being under `DefaultLoadControl.bufferForPlayback`. Therefore, we check if there is any loading error in `isLoadingPossible`, so that the player will allow the playback of the existing data rather than waiting forever for the data that can never be loaded.

Issue: #1571
PiperOrigin-RevId: 665801674
(cherry picked from commit 351593a)
@tianyif
Copy link
Contributor

tianyif commented Aug 28, 2024

The fix is now in 1.4.1.

@tianyif tianyif closed this as completed Aug 28, 2024
@androidx androidx locked and limited conversation to collaborators Oct 28, 2024
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