mirror of
https://github.com/zoriya/react-native-video.git
synced 2025-12-19 21:55:15 +00:00
Feature implementation: Failure Retry Count
Feature implementation: Failure Retry Count
This commit is contained in:
@@ -114,6 +114,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
private boolean isBuffering;
|
||||
private float rate = 1f;
|
||||
private float audioVolume = 1f;
|
||||
private int failureRetryCount = 3;
|
||||
private int maxBitRate = 0;
|
||||
private long seekTime = C.TIME_UNSET;
|
||||
|
||||
@@ -310,12 +311,17 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
switch (type) {
|
||||
case C.TYPE_SS:
|
||||
return new SsMediaSource(uri, buildDataSourceFactory(false),
|
||||
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
|
||||
new DefaultSsChunkSource.Factory(mediaDataSourceFactory),
|
||||
failureRetryCount, SsMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS,
|
||||
mainHandler, null);
|
||||
case C.TYPE_DASH:
|
||||
return new DashMediaSource(uri, buildDataSourceFactory(false),
|
||||
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
|
||||
new DefaultDashChunkSource.Factory(mediaDataSourceFactory),
|
||||
failureRetryCount, DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS,
|
||||
mainHandler, null);
|
||||
case C.TYPE_HLS:
|
||||
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, null);
|
||||
return new HlsMediaSource(uri, mediaDataSourceFactory,
|
||||
failureRetryCount, mainHandler, null);
|
||||
case C.TYPE_OTHER:
|
||||
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
|
||||
mainHandler, null);
|
||||
@@ -998,6 +1004,11 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
}
|
||||
}
|
||||
|
||||
public void setfailureRetryCountModifier(int newFailureRetryCount) {
|
||||
failureRetryCount = newFailureRetryCount;
|
||||
releasePlayer();
|
||||
initializePlayer();
|
||||
}
|
||||
|
||||
public void setPlayInBackground(boolean playInBackground) {
|
||||
this.playInBackground = playInBackground;
|
||||
|
||||
Reference in New Issue
Block a user