Fixes #13904 - ExoPlayer can't start a new audio from a seek point #13905
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #13904
First time contributor checklist
Contributor checklist
Fixes #1234
syntaxDescription
After doing some research I have found that exoplayer can not seek to a position if it does not have the required information for the file, and it can only get the information once it is ready, so we need to first call the
play.prepare()
, but this does not guarantee that after this line the player will be ready and got the required information, so need to add a callback that will seek to the required position for the first audio file.Screenshot after fixing:
document_6064240865558139971.mp4
NOTE:
This solution is only applicable if we are playing one audio and won't work for consecutive audio plays, as we only have the progress/seek position information for the first audio file when consecutive call is made.
Possible solution:
We might need to pass or store the progress information of all the consecutive audio files we are about to play. This can require a larger refactoring of the Controller file, so I have not touched it yet.