fix(avoid): avoid early return in setSrc (#3759)
* 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
This commit is contained in:
parent
e420418e8f
commit
2e623ca0fb
@ -1646,15 +1646,14 @@ public class ReactExoplayerView extends FrameLayout implements
|
|||||||
if (this.customMetadata != customMetadata && player != null) {
|
if (this.customMetadata != customMetadata && player != null) {
|
||||||
MediaItem currentMediaItem = player.getCurrentMediaItem();
|
MediaItem currentMediaItem = player.getCurrentMediaItem();
|
||||||
|
|
||||||
if (currentMediaItem == null) {
|
if (currentMediaItem != null) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
// This will cause video blink/reload but won't louse progress
|
||||||
player.setMediaItem(newMediaItem, false);
|
player.setMediaItem(newMediaItem, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
boolean isSourceEqual = uri.equals(srcUri) && cropStartMs == this.cropStartMs && cropEndMs == this.cropEndMs;
|
boolean isSourceEqual = uri.equals(srcUri) && cropStartMs == this.cropStartMs && cropEndMs == this.cropEndMs;
|
||||||
|
Loading…
Reference in New Issue
Block a user