mirror of
https://github.com/zoriya/react-native-video.git
synced 2025-12-21 06:35:14 +00:00
Add progressUpdateInterval to android-exoplayer (#540)
This commit is contained in:
committed by
Matt Apperson
parent
ebc6617ba4
commit
c45f5f5b38
@@ -50,6 +50,7 @@ import com.google.android.exoplayer2.util.Util;
|
||||
import java.net.CookieHandler;
|
||||
import java.net.CookieManager;
|
||||
import java.net.CookiePolicy;
|
||||
import java.lang.Math;
|
||||
|
||||
@SuppressLint("ViewConstructor")
|
||||
class ReactExoplayerView extends FrameLayout implements
|
||||
@@ -91,6 +92,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
private String extension;
|
||||
private boolean repeat;
|
||||
private boolean disableFocus;
|
||||
private float mProgressUpdateInterval = 250.0f;
|
||||
// \ End props
|
||||
|
||||
// React
|
||||
@@ -110,7 +112,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
long pos = player.getCurrentPosition();
|
||||
eventEmitter.progressChanged(pos, player.getBufferedPercentage());
|
||||
msg = obtainMessage(SHOW_PROGRESS);
|
||||
sendMessageDelayed(msg, 1000 - (pos % 1000));
|
||||
sendMessageDelayed(msg, Math.round(mProgressUpdateInterval));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -533,6 +535,10 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
}
|
||||
}
|
||||
|
||||
public void setProgressUpdateInterval(final float progressUpdateInterval) {
|
||||
mProgressUpdateInterval = progressUpdateInterval;
|
||||
}
|
||||
|
||||
public void setRawSrc(final Uri uri, final String extension) {
|
||||
if (uri != null) {
|
||||
boolean isOriginalSourceNull = srcUri == null;
|
||||
|
||||
Reference in New Issue
Block a user