Unverified Commit 39b47577 authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge pull request #1355 from vadimgoroshevsky/master

ExoPlayer - Add possibility to hide shutterView (black screen while loading)
parents a34f6e7b 308aa4ae
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@

### Version 4.0.1
* Add missing files to package.json [#1342](https://github.com/react-native-community/react-native-video/pull/1342)
* Add possibility to remove black screen while video is loading in Exoplayer [#1355](https://github.com/react-native-community/react-native-video/pull/1355)

### Version 4.0.0
* Partial support for timed metadata on Android MediaPlayer [#707](https://github.com/react-native-community/react-native-video/pull/707)
+9 −0
Changes for README.md: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -264,6 +264,7 @@ var styles = StyleSheet.create({
* [fullscreenAutorotate](#fullscreenautorotate)
* [fullscreenOrientation](#fullscreenorientation)
* [headers](#headers)
* [hideShutterView](#hideshutterview)
* [id](#id)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [muted](#muted)
@@ -417,6 +418,14 @@ headers={{

Platforms: Android ExoPlayer

#### hideShutterView
Controls whether the ExoPlayer shutter view (black screen while loading) is enabled.

* **false (default)** - Show shutter view 
* **true** - Hide shutter view

Platforms: Android ExoPlayer

#### id
Set the DOM id element so you can use document.getElementById on web platforms. Accepts string values.

+1 −0
Changes for Video.js: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -383,6 +383,7 @@ Video.propTypes = {
  fullscreenOrientation: PropTypes.oneOf(['all','landscape','portrait']),
  progressUpdateInterval: PropTypes.number,
  useTextureView: PropTypes.bool,
  hideShutterView: PropTypes.bool,
  onLoadStart: PropTypes.func,
  onLoad: PropTypes.func,
  onBuffer: PropTypes.func,
+10 −0
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public final class ExoPlayerView extends FrameLayout {
    private ViewGroup.LayoutParams layoutParams;

    private boolean useTextureView = false;
    private boolean hideShutterView = false;

    public ExoPlayerView(Context context) {
        this(context, null);
@@ -106,6 +107,10 @@ public final class ExoPlayerView extends FrameLayout {
        }
    }

    private void updateShutterViewVisibility() {
        shutterView.setVisibility(this.hideShutterView ? View.INVISIBLE : View.VISIBLE);
    }

    /**
     * Set the {@link SimpleExoPlayer} to use. The {@link SimpleExoPlayer#setTextOutput} and
     * {@link SimpleExoPlayer#setVideoListener} method of the player will be called and previous
@@ -161,6 +166,11 @@ public final class ExoPlayerView extends FrameLayout {
        updateSurfaceView();
    }

    public void setHideShutterView(boolean hideShutterView) {
        this.hideShutterView = hideShutterView;
        updateShutterViewVisibility();
    }

    private final Runnable measureAndLayout = new Runnable() {
        @Override
        public void run() {
+5 −0
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ class ReactExoplayerView extends FrameLayout implements
    private float mProgressUpdateInterval = 250.0f;
    private boolean playInBackground = false;
    private boolean useTextureView = false;
    private boolean hideShutterView = false;
    private Map<String, String> requestHeaders;
    // \ End props

@@ -954,6 +955,10 @@ class ReactExoplayerView extends FrameLayout implements
        exoPlayerView.setUseTextureView(useTextureView);
    }

    public void setHideShutterView(boolean hideShutterView) {
        exoPlayerView.setHideShutterView(hideShutterView);
    }

    public void setBufferConfig(int newMinBufferMs, int newMaxBufferMs, int newBufferForPlaybackMs, int newBufferForPlaybackAfterRebufferMs) {
        minBufferMs = newMinBufferMs;
        maxBufferMs = newMaxBufferMs;
Loading