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

bug(android): update buffering metadata when any event emitted #4

Merged

Conversation

MateusHBR
Copy link

@MateusHBR MateusHBR commented May 28, 2024

When the video is paused, 'onPlaybackStateChanged' callback is never called more than once, this happens because the state is not different from the previous. The problem occours because the current implementation just send bufferingUpdates when the state change from BUFFERING to READY for example, but based on the settings of the LoadControl that is responsible for downloading the video frames, it downloads until 50seconds of video, and the state could be ready but the segments under the hood is being cached in memory.

Based on the screenshot below, you could see that the state could be ready because is necessary at least 2.5 seconds to play a video, and this is enough to the state be ready to play and not buffering.

What I did is on any event emitted, We will update the metadata of buffering stored in the Dart layer that is the responsible for the bug mentioned in the card.

Screenshot 2024-05-28 at 09 46 02

The OnEvents was suggested by the docs of Android https://developer.android.com/media/media3/exoplayer/listening-to-player-events#individual-callbacks

Solves the problem in the card: https://www.notion.so/indaband/Track-is-never-selected-when-there-are-some-tracks-selected-previously-352a9b946ef845989aab0c08be448291?pvs=4

@MateusHBR MateusHBR merged commit 6df8abc into master May 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants