mirror of https://github.com/nextcloud/android
Merge pull request #10181 from nextcloud/videoFullscreenPause
Correctly obey play/pause state
This commit is contained in:
parent
b950be1f7d
commit
8d4ed0a862
|
@ -506,7 +506,10 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
|
|||
if (savedPlaybackPosition >= 0) {
|
||||
exoPlayer.seekTo(savedPlaybackPosition);
|
||||
}
|
||||
exoPlayer.play();
|
||||
|
||||
if (autoplay) {
|
||||
exoPlayer.play();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -575,7 +578,6 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
autoplay = false;
|
||||
if(getActivity() instanceof FileDisplayActivity){
|
||||
((FileDisplayActivity) getActivity()).configureToolbarForMediaPreview(getFile());
|
||||
}
|
||||
|
|
|
@ -114,6 +114,8 @@ class PreviewVideoActivity :
|
|||
if (mSavedPlaybackPosition >= 0) {
|
||||
exoPlayer?.seekTo(mSavedPlaybackPosition)
|
||||
}
|
||||
|
||||
onIsPlayingChanged(exoPlayer!!.isPlaying)
|
||||
}
|
||||
|
||||
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
||||
|
@ -200,7 +202,10 @@ class PreviewVideoActivity :
|
|||
private fun play(item: MediaItem) {
|
||||
exoPlayer?.addMediaItem(item)
|
||||
exoPlayer?.prepare()
|
||||
exoPlayer?.play()
|
||||
|
||||
if (mAutoplay) {
|
||||
exoPlayer?.play()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
@ -220,6 +225,7 @@ class PreviewVideoActivity :
|
|||
else -> MediaItem.fromUri(mStreamUri!!)
|
||||
}
|
||||
if (exoPlayer != null) {
|
||||
setupPlayerView()
|
||||
play(mediaItem)
|
||||
} else {
|
||||
val context = this
|
||||
|
|
Loading…
Reference in New Issue