Skip to content

Commit

Permalink
Added Patch created apollos as a permanent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rajitharussel committed Dec 29, 2023
1 parent eef48e4 commit 139d695
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ public void onHostResume() {
isInBackground = false;
}

public void setShowControlsModifier(final boolean showControls) {
if(player == null) return;
reLayout(playerControlView);
if (showControls) {
playerControlView.show();
}
else {
playerControlView.hide();
}
}

@Override
public void onHostPause() {
isInBackground = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
private static final String PROP_HIDE_SHUTTER_VIEW = "hideShutterView";
private static final String PROP_CONTROLS = "controls";

public static final String PROP_SHOW_CONTROLS = "showControls";

private ReactExoplayerConfig config;

public ReactExoplayerViewManager(ReactExoplayerConfig config) {
Expand Down Expand Up @@ -314,6 +316,11 @@ public void setControls(final ReactExoplayerView videoView, final boolean contro
videoView.setControls(controls);
}

@ReactProp(name = PROP_SHOW_CONTROLS, defaultBoolean = false)
public void setShowControls(final ReactExoplayerView videoView, final boolean control) {
videoView.setShowControlsModifier(control);
}

@ReactProp(name = PROP_BUFFER_CONFIG)
public void setBufferConfig(final ReactExoplayerView videoView, @Nullable ReadableMap bufferConfig) {
int minBufferMs = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ public void setPausedModifier(final boolean paused) {
setKeepScreenOn(!mPaused && mPreventsDisplaySleepDuringVideoPlayback);
}


public void setShowControlsModifier(final boolean paused) {
if (mUseNativeControls) {
initializeMediaControllerIfNeeded();
mediaController.show();
}
}

// reduces the volume based on stereoPan
private float calulateRelativeVolume() {
float relativeVolume = (mVolume * (1 - Math.abs(mStereoPan)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ReactVideoViewManager extends SimpleViewManager<ReactVideoView> {
public static final String PROP_RESIZE_MODE = "resizeMode";
public static final String PROP_REPEAT = "repeat";
public static final String PROP_PAUSED = "paused";
public static final String PROP_SHOW_CONTROLS = "showControls";
public static final String PROP_MUTED = "muted";
public static final String PROP_PREVENTS_DISPLAY_SLEEP_DURING_VIDEO_PLAYBACK = "preventsDisplaySleepDuringVideoPlayback";
public static final String PROP_VOLUME = "volume";
Expand Down Expand Up @@ -125,6 +126,11 @@ public void setPaused(final ReactVideoView videoView, final boolean paused) {
videoView.setPausedModifier(paused);
}

@ReactProp(name = PROP_SHOW_CONTROLS, defaultBoolean = false)
public void setShowControls(final ReactVideoView videoView, final boolean control) {
videoView.setShowControlsModifier(control);
}

@ReactProp(name = PROP_MUTED, defaultBoolean = false)
public void setMuted(final ReactVideoView videoView, final boolean muted) {
videoView.setMutedModifier(muted);
Expand Down

0 comments on commit 139d695

Please sign in to comment.