Fix runtime issues

This commit is contained in:
Armands Malejevs 2022-03-30 15:27:09 +03:00
parent bd1f7f50cb
commit edd3cc1698

View File

@ -537,13 +537,13 @@ class ReactExoplayerView extends FrameLayout implements
@Override @Override
public void run () { public void run () {
// Source initialization must run on the main thread // Source initialization must run on the main thread
initializePlayerSource(self, drmSessionManager); initializePlayerSource(self, drmSessionManager, srcUri);
} }
}); });
} }
}); });
} else { } else {
initializePlayerSource(self, null); initializePlayerSource(self, null, srcUri);
} }
@ -613,9 +613,9 @@ class ReactExoplayerView extends FrameLayout implements
return drmSessionManager; return drmSessionManager;
} }
private void initializePlayerSource(ReactExoplayerView self, DrmSessionManager drmSessionManager) { private void initializePlayerSource(ReactExoplayerView self, DrmSessionManager drmSessionManager, Uri srcUri) {
ArrayList<MediaSource> mediaSourceList = buildTextSources(); ArrayList<MediaSource> mediaSourceList = buildTextSources();
MediaSource videoSource = self.buildMediaSource(self.srcUri, self.extension, drmSessionManager); MediaSource videoSource = self.buildMediaSource(srcUri, self.extension, drmSessionManager);
MediaSource mediaSource; MediaSource mediaSource;
if (mediaSourceList.size() == 0) { if (mediaSourceList.size() == 0) {
mediaSource = videoSource; mediaSource = videoSource;