mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
Fix for Furilabs phone (thanks @Aleks K)
This commit is contained in:
+17
-3
@@ -459,7 +459,14 @@ class VideoDetailFragment() : MainFragment() {
|
||||
val params = _viewDetail?.getPictureInPictureParams();
|
||||
if(params != null) {
|
||||
Logger.i(TAG, "enterPictureInPictureMode")
|
||||
activity?.enterPictureInPictureMode(params);
|
||||
|
||||
try {
|
||||
activity?.enterPictureInPictureMode(params);
|
||||
} catch(e: IllegalStateException) {
|
||||
if(e.message?.contains("Device doesn't support picture-in-picture") != true) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,8 +477,15 @@ class VideoDetailFragment() : MainFragment() {
|
||||
|
||||
fun forcePictureInPicture() {
|
||||
val params = _viewDetail?.getPictureInPictureParams();
|
||||
if(params != null)
|
||||
activity?.enterPictureInPictureMode(params);
|
||||
if(params != null) {
|
||||
try {
|
||||
activity?.enterPictureInPictureMode(params);
|
||||
} catch(e: IllegalStateException) {
|
||||
if(e.message?.contains("Device doesn't support picture-in-picture") != true) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, isStop: Boolean, newConfig: Configuration) {
|
||||
try {
|
||||
|
||||
+8
-1
@@ -694,7 +694,14 @@ class VideoDetailView : ConstraintLayout {
|
||||
|
||||
onShouldEnterPictureInPictureChanged.subscribe {
|
||||
val params = getPictureInPictureParams()
|
||||
fragment.activity?.setPictureInPictureParams(params)
|
||||
|
||||
try {
|
||||
fragment.activity?.setPictureInPictureParams(params)
|
||||
} catch(e: IllegalStateException) {
|
||||
if(e.message?.contains("Device doesn't support picture-in-picture") != true) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isInEditMode) {
|
||||
|
||||
Reference in New Issue
Block a user