fixing duplicate controlelrs
This commit is contained in:
parent
7afb000b47
commit
9eaa9abaec
@ -61,7 +61,7 @@ import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY;
|
|||||||
public class VideoPlayActivity extends AppCompatActivity {
|
public class VideoPlayActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private static final String TAG = "VideoPlayActivity";
|
private static final String TAG = "VideoPlayActivity";
|
||||||
|
VideoPlayerFragment videoPlayerFragment;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -109,7 +109,7 @@ public class VideoPlayActivity extends AppCompatActivity {
|
|||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
setIntent(intent);
|
setIntent(intent);
|
||||||
VideoPlayerFragment videoPlayerFragment = (VideoPlayerFragment)
|
videoPlayerFragment = (VideoPlayerFragment)
|
||||||
getSupportFragmentManager().findFragmentById(R.id.video_player_fragment);
|
getSupportFragmentManager().findFragmentById(R.id.video_player_fragment);
|
||||||
assert videoPlayerFragment != null;
|
assert videoPlayerFragment != null;
|
||||||
String videoUuid = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
|
String videoUuid = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
|
||||||
@ -355,8 +355,11 @@ public class VideoPlayActivity extends AppCompatActivity {
|
|||||||
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
|
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
|
||||||
if (isInPictureInPictureMode) {
|
if (isInPictureInPictureMode) {
|
||||||
Log.v(TAG,"switched to pip ");
|
Log.v(TAG,"switched to pip ");
|
||||||
|
videoPlayerFragment.useController(false);
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG,"switched to normal");
|
Log.v(TAG,"switched to normal");
|
||||||
|
videoPlayerFragment.useController(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,9 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public void useController(boolean value){
|
||||||
|
simpleExoPlayerView.setUseController(value);
|
||||||
|
}
|
||||||
private void playVideo(Video video) {
|
private void playVideo(Video video) {
|
||||||
|
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
|
@ -130,8 +130,12 @@ public class VideoPlayerService extends Service {
|
|||||||
playerNotificationManager.setPlayer(null);
|
playerNotificationManager.setPlayer(null);
|
||||||
}
|
}
|
||||||
//Was seeing an error when exiting the program about about not unregistering the receiver.
|
//Was seeing an error when exiting the program about about not unregistering the receiver.
|
||||||
if (null!=myNoisyAudioStreamReceiver) {
|
try {
|
||||||
this.unregisterReceiver(myNoisyAudioStreamReceiver);
|
if (null!=myNoisyAudioStreamReceiver) {
|
||||||
|
this.unregisterReceiver(myNoisyAudioStreamReceiver);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("VideoPlayerService", "attempted to unregister a nonregistered service");
|
||||||
}
|
}
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.release();
|
player.release();
|
||||||
|
Loading…
Reference in New Issue
Block a user