Remove buffer progress event

This commit is contained in:
Armands Malejevs
2022-06-08 11:29:09 +03:00
parent e90ab21c91
commit 8a057c553b
5 changed files with 0 additions and 60 deletions

View File

@@ -169,7 +169,6 @@ class ReactExoplayerView extends FrameLayout implements
private double minBackBufferMemoryReservePercent = ReactExoplayerView.DEFAULT_MIN_BACK_BUFFER_MEMORY_RESERVE;
private double minBufferMemoryReservePercent = ReactExoplayerView.DEFAULT_MIN_BUFFER_MEMORY_RESERVE;
private Handler mainHandler;
private Timer bufferCheckTimer;
// Props from React
private int backBufferDurationMs = DefaultLoadControl.DEFAULT_BACK_BUFFER_DURATION_MS;
@@ -477,36 +476,6 @@ class ReactExoplayerView extends FrameLayout implements
VideoEventEmitter eventEmitter = this.eventEmitter;
Handler mainHandler = this.mainHandler;
if (this.bufferCheckTimer != null) {
this.stopBufferCheckTimer();
}
this.bufferCheckTimer = new Timer();
TimerTask bufferCheckTimerTask = new TimerTask() {
@Override
public void run() {
if (mainHandler != null) {
mainHandler.post(new Runnable() {
public void run() {
if (player != null) {
double bufferedDuration = (double) (player.getBufferedPercentage() * player.getDuration() / 100);
eventEmitter.bufferProgress(0d, bufferedDuration);
}
}
});
}
};
};
this.bufferCheckTimer.scheduleAtFixedRate(bufferCheckTimerTask, 500, 1000);
}
private void stopBufferCheckTimer() {
if (this.bufferCheckTimer == null) {
return;
}
this.bufferCheckTimer.cancel();
this.bufferCheckTimer = null;
}
private void initializePlayer() {
@@ -779,7 +748,6 @@ class ReactExoplayerView extends FrameLayout implements
private void releasePlayer() {
if (player != null) {
stopBufferCheckTimer();
updateResumePosition();
player.release();
player.removeMetadataOutput(this);

View File

@@ -45,7 +45,6 @@ class VideoEventEmitter {
private static final String EVENT_READY = "onReadyForDisplay";
private static final String EVENT_BUFFER = "onVideoBuffer";
private static final String EVENT_PLAYBACK_STATE_CHANGED = "onVideoPlaybackStateChanged";
private static final String EVENT_BUFFER_PROGRESS = "onVideoBufferProgress";
private static final String EVENT_IDLE = "onVideoIdle";
private static final String EVENT_TIMED_METADATA = "onTimedMetadata";
private static final String EVENT_AUDIO_BECOMING_NOISY = "onVideoAudioBecomingNoisy";
@@ -225,13 +224,6 @@ class VideoEventEmitter {
receiveEvent(EVENT_PLAYBACK_STATE_CHANGED, map);
}
void bufferProgress(double start, double end) {
WritableMap map = Arguments.createMap();
map.putDouble(EVENT_PROP_BUFFER_START, start);
map.putDouble(EVENT_PROP_BUFFER_END, end);
receiveEvent(EVENT_BUFFER_PROGRESS, map);
}
void idle() {
receiveEvent(EVENT_IDLE, null);
}