Skip to content

Commit

Permalink
fix(avoid): avoid early return in setSrc (#3759)
Browse files Browse the repository at this point in the history
* perf: ensure we do not provide callback to native if no callback provided from app

* chore: rework bufferConfig to make it more generic and reduce ReactExoplayerView code size

* fix(android): avoid easly return in setSrc
  • Loading branch information
freeboub authored May 13, 2024
1 parent e420418 commit 2e623ca
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1646,14 +1646,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

0 comments on commit 2e623ca

Please sign in to comment.