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(avoid): avoid early return in setSrc #3759

Merged
merged 5 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1647,14 +1647,13 @@ public void setSrc(final Uri uri, final long startPositionMs, final long cropSta
if (this.customMetadata != customMetadata && player != null) {
MediaItem currentMediaItem = player.getCurrentMediaItem();

if (currentMediaItem == null) {
return;
}
if (currentMediaItem != null) {

MediaItem newMediaItem = currentMediaItem.buildUpon().setMediaMetadata(customMetadata).build();
MediaItem newMediaItem = currentMediaItem.buildUpon().setMediaMetadata(customMetadata).build();

// This will cause video blink/reload but won't louse progress
player.setMediaItem(newMediaItem, false);
// This will cause video blink/reload but won't louse progress
player.setMediaItem(newMediaItem, false);
}
}

if (uri != null) {
Expand Down
Loading