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:
+15
-1
@@ -459,7 +459,14 @@ class VideoDetailFragment() : MainFragment() {
|
|||||||
val params = _viewDetail?.getPictureInPictureParams();
|
val params = _viewDetail?.getPictureInPictureParams();
|
||||||
if(params != null) {
|
if(params != null) {
|
||||||
Logger.i(TAG, "enterPictureInPictureMode")
|
Logger.i(TAG, "enterPictureInPictureMode")
|
||||||
|
|
||||||
|
try {
|
||||||
activity?.enterPictureInPictureMode(params);
|
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() {
|
fun forcePictureInPicture() {
|
||||||
val params = _viewDetail?.getPictureInPictureParams();
|
val params = _viewDetail?.getPictureInPictureParams();
|
||||||
if(params != null)
|
if(params != null) {
|
||||||
|
try {
|
||||||
activity?.enterPictureInPictureMode(params);
|
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) {
|
fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, isStop: Boolean, newConfig: Configuration) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+7
@@ -694,7 +694,14 @@ class VideoDetailView : ConstraintLayout {
|
|||||||
|
|
||||||
onShouldEnterPictureInPictureChanged.subscribe {
|
onShouldEnterPictureInPictureChanged.subscribe {
|
||||||
val params = getPictureInPictureParams()
|
val params = getPictureInPictureParams()
|
||||||
|
|
||||||
|
try {
|
||||||
fragment.activity?.setPictureInPictureParams(params)
|
fragment.activity?.setPictureInPictureParams(params)
|
||||||
|
} catch(e: IllegalStateException) {
|
||||||
|
if(e.message?.contains("Device doesn't support picture-in-picture") != true) {
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInEditMode) {
|
if (!isInEditMode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user