Loading android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +17 −7 Original line number Diff line number Diff line Loading @@ -281,11 +281,6 @@ class ReactExoplayerView extends FrameLayout implements if(playerControlView == null) { playerControlView = new PlayerControlView(getContext()); } LayoutParams layoutParams = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); playerControlView.setLayoutParams(layoutParams); addView(playerControlView, 1, layoutParams); //Setting the player for the playerControlView playerControlView.setPlayer(player); Loading @@ -305,12 +300,24 @@ class ReactExoplayerView extends FrameLayout implements @Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { reLayout(playPauseControlContainer); //Remove this eventListener once its executed. since UI will work fine once after the reLayout is done player.removeListener(eventListener); } }; player.addListener(eventListener); } /** * Adding Player control to the frame layout */ private void addPlayerControl() { LayoutParams layoutParams = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); playerControlView.setLayoutParams(layoutParams); addView(playerControlView, 1, layoutParams); } /** * Update the layout * Loading Loading @@ -369,6 +376,9 @@ class ReactExoplayerView extends FrameLayout implements eventEmitter.loadStart(); loadVideoStarted = true; } //Initializing the playerControlView initializePlayerControl(); } private MediaSource buildMediaSource(Uri uri, String overrideExtension) { Loading Loading @@ -1135,8 +1145,8 @@ class ReactExoplayerView extends FrameLayout implements */ public void setControls(boolean controls) { if(controls && (exoPlayerView != null)) { //Initialize playerControlView initializePlayerControl(); //adding the playerControlView addPlayerControl(); } else { if(getChildAt(1) instanceof PlayerControlView && (exoPlayerView != null)){ removeViewAt(1); Loading Loading
android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +17 −7 Original line number Diff line number Diff line Loading @@ -281,11 +281,6 @@ class ReactExoplayerView extends FrameLayout implements if(playerControlView == null) { playerControlView = new PlayerControlView(getContext()); } LayoutParams layoutParams = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); playerControlView.setLayoutParams(layoutParams); addView(playerControlView, 1, layoutParams); //Setting the player for the playerControlView playerControlView.setPlayer(player); Loading @@ -305,12 +300,24 @@ class ReactExoplayerView extends FrameLayout implements @Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { reLayout(playPauseControlContainer); //Remove this eventListener once its executed. since UI will work fine once after the reLayout is done player.removeListener(eventListener); } }; player.addListener(eventListener); } /** * Adding Player control to the frame layout */ private void addPlayerControl() { LayoutParams layoutParams = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); playerControlView.setLayoutParams(layoutParams); addView(playerControlView, 1, layoutParams); } /** * Update the layout * Loading Loading @@ -369,6 +376,9 @@ class ReactExoplayerView extends FrameLayout implements eventEmitter.loadStart(); loadVideoStarted = true; } //Initializing the playerControlView initializePlayerControl(); } private MediaSource buildMediaSource(Uri uri, String overrideExtension) { Loading Loading @@ -1135,8 +1145,8 @@ class ReactExoplayerView extends FrameLayout implements */ public void setControls(boolean controls) { if(controls && (exoPlayerView != null)) { //Initialize playerControlView initializePlayerControl(); //adding the playerControlView addPlayerControl(); } else { if(getChildAt(1) instanceof PlayerControlView && (exoPlayerView != null)){ removeViewAt(1); Loading