Dont download dash manifest if contentStartTime is not set

This commit is contained in:
Armands Malejevs 2022-06-02 15:08:07 +03:00
parent 9b04cfac51
commit 0330943d52

View File

@ -185,7 +185,7 @@ class ReactExoplayerView extends FrameLayout implements
private ReadableArray textTracks; private ReadableArray textTracks;
private boolean disableFocus; private boolean disableFocus;
private boolean disableBuffering; private boolean disableBuffering;
private long contentStartTime; private long contentStartTime = -1L;
private boolean disableDisconnectError; private boolean disableDisconnectError;
private boolean preventsDisplaySleepDuringVideoPlayback = true; private boolean preventsDisplaySleepDuringVideoPlayback = true;
private float mProgressUpdateInterval = 250.0f; private float mProgressUpdateInterval = 250.0f;
@ -1068,11 +1068,13 @@ class ReactExoplayerView extends FrameLayout implements
} }
private WritableArray getVideoTrackInfo(int trackRendererIndex) { private WritableArray getVideoTrackInfo(int trackRendererIndex) {
if (this.contentStartTime != -1L) {
WritableArray contentVideoTracks = this.getVideoTrackInfoFromManifest(); WritableArray contentVideoTracks = this.getVideoTrackInfoFromManifest();
if (contentVideoTracks != null) { if (contentVideoTracks != null) {
isUsingContentResolution = true; isUsingContentResolution = true;
return contentVideoTracks; return contentVideoTracks;
} }
}
WritableArray videoTracks = Arguments.createArray(); WritableArray videoTracks = Arguments.createArray();
@ -1107,6 +1109,7 @@ class ReactExoplayerView extends FrameLayout implements
return this.getVideoTrackInfoFromManifest(0); return this.getVideoTrackInfoFromManifest(0);
} }
// We need retry count to in case where minefest request fails from poor network conditions
private WritableArray getVideoTrackInfoFromManifest(int retryCount) { private WritableArray getVideoTrackInfoFromManifest(int retryCount) {
ExecutorService es = Executors.newSingleThreadExecutor(); ExecutorService es = Executors.newSingleThreadExecutor();
final DataSource dataSource = this.mediaDataSourceFactory.createDataSource(); final DataSource dataSource = this.mediaDataSourceFactory.createDataSource();