mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-03-09 16:10:09 +01:00
Fix mini video view not supported on some devices
This commit is contained in:
parent
3353b7205b
commit
f31b6e9ac8
@ -18,6 +18,7 @@ import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.PictureInPictureParams;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@ -220,8 +221,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||
}
|
||||
playInMinimized = sharedpreferences.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|
||||
&& !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O
|
||||
|| !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||
playInMinimized = false;
|
||||
}
|
||||
|
||||
@ -911,7 +912,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
private void enterVideoMode() {
|
||||
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && player != null) {
|
||||
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && player != null) {
|
||||
isPlayInMinimized = true;
|
||||
MediaSessionCompat mediaSession = new MediaSessionCompat(this, getPackageName());
|
||||
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
|
||||
@ -920,7 +921,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
controlView.hide();
|
||||
binding.mediaVideo.setControllerAutoShow(false);
|
||||
mediaSession.setActive(true);
|
||||
enterPictureInPictureMode();
|
||||
PictureInPictureParams params = new PictureInPictureParams.Builder().build();
|
||||
enterPictureInPictureMode(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user