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

fix(android): prevent changing resolution video track when video load #3683

Merged

Conversation

YangJonghun
Copy link
Collaborator

@YangJonghun YangJonghun commented Apr 16, 2024

Summary

fix(android): prevent changing resolution video track when video load

Motivation

  • for prevent resolution video track changed by react prop when video is initially loaded
  • In the above case, the isUsingContentResolution and selectTrackWhenReady flags don't work

Changes

  • setSelectedVideoTrack doesn't call setSelectedTrack when loadVideoStarted is true, it will call within videoLoaded after video ready

Test plan

- video track must change after video loaded, if change with load state, ready state can be called
@YangJonghun YangJonghun changed the title fix(android): prevent changing video track when video load fix(android): prevent changing resolution video track when video load Apr 16, 2024
Copy link
Collaborator

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@freeboub
Copy link
Collaborator

Do you use contentStartTime ?

@YangJonghun
Copy link
Collaborator Author

@freeboub
no I don't

@freeboub
Copy link
Collaborator

@YangJonghun Ok, thank you (sorry for the very quick question !)
I don't really understand why you need to do this change as setSelectedTrack will not do anything in case of no video track available.
Additionally, instead of putting doing the setSelected track in onLoad, I think it would make more sense to do it in the onVideoTrackAvailable. In some case, we can have the track list changing during the playback, in that case the selectedVideoTrack will not be reapplied.

Let say it looks good to me, but please can you detail what is the issue of selecting video tracks when the video is not loaded ?

@YangJonghun
Copy link
Collaborator Author

@freeboub
I'm sorry to late response. I'm on vacation, so it's hard to provide any sample code.
It was a problem that video start buffer and stucked.
here is how to reproduce. (I'm not sure to reproduce. it was production's problem)

  1. play master mpd source (includes mutiple resolution) with specific resolution track(specify with prop).
  2. source prop change (also it is master and includes same resolutions).
  3. player doesn't work(on load never called) before call seek function.

I know we have to set resolutions after source is ready, but developers can't easily recognize or misuses even they know that(it is so hard to debug)

@freeboub freeboub merged commit 6f61d7f into TheWidlarzGroup:master Apr 22, 2024
3 checks passed
@YangJonghun YangJonghun deleted the fix/prevent-changing-video-track branch April 22, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants