Support preventsDisplaySleepDuringVideoPlayback (#2019)
* Add flag on iOS * Add flag in Android * Add documentation * Add changelog entry * Also set setKeepScreenOn * Fix prop not being set * add preventsDisplaySleepDuringVideoPlayback to exoplayer * Update android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java * Update android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java Co-authored-by: Jens Andersson <jens@fritan.com> Co-authored-by: Anton Tanderup <antontandrup@gmail.com> Co-authored-by: Jens Andersson <jens@fritan.com>
This commit is contained in:
@@ -44,6 +44,7 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
|
||||
private static final String PROP_BUFFER_CONFIG_MAX_BUFFER_MS = "maxBufferMs";
|
||||
private static final String PROP_BUFFER_CONFIG_BUFFER_FOR_PLAYBACK_MS = "bufferForPlaybackMs";
|
||||
private static final String PROP_BUFFER_CONFIG_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = "bufferForPlaybackAfterRebufferMs";
|
||||
private static final String PROP_PREVENTS_DISPLAY_SLEEP_DURING_VIDEO_PLAYBACK = "preventsDisplaySleepDuringVideoPlayback";
|
||||
private static final String PROP_PROGRESS_UPDATE_INTERVAL = "progressUpdateInterval";
|
||||
private static final String PROP_REPORT_BANDWIDTH = "reportBandwidth";
|
||||
private static final String PROP_SEEK = "seek";
|
||||
@@ -150,6 +151,11 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
|
||||
videoView.setRepeatModifier(repeat);
|
||||
}
|
||||
|
||||
@ReactProp(name = PROP_PREVENTS_DISPLAY_SLEEP_DURING_VIDEO_PLAYBACK, defaultBoolean = false)
|
||||
public void setPreventsDisplaySleepDuringVideoPlayback(final ReactExoplayerView videoView, final boolean preventsSleep) {
|
||||
videoView.setPreventsDisplaySleepDuringVideoPlayback(preventsSleep);
|
||||
}
|
||||
|
||||
@ReactProp(name = PROP_SELECTED_VIDEO_TRACK)
|
||||
public void setSelectedVideoTrack(final ReactExoplayerView videoView,
|
||||
@Nullable ReadableMap selectedVideoTrack) {
|
||||
|
Reference in New Issue
Block a user