[Android] PiP: catch IllegalArgumentException

Geoffrey Métais git at videolan.org
Tue Dec 24 12:11:43 CET 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 24 07:58:55 2019 +0000| [5416fd9d268e5edb1f6754355887f2e1a58ce2b1] | committer: Geoffrey Métais

PiP: catch IllegalArgumentException

Could happen if asptect ratio is extreme.


(cherry picked from commit ca418f49eb961397ba629c94f7f784b99af61c5b)

> https://code.videolan.org/videolan/vlc-android/commit/5416fd9d268e5edb1f6754355887f2e1a58ce2b1
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 99f7985cf..8e4d6944e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -1611,6 +1611,14 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
         return AndroidUtil.isNougatOrLater && super.isInPictureInPictureMode()
     }
 
+    override fun setPictureInPictureParams(params: PictureInPictureParams) {
+        try {
+            super.setPictureInPictureParams(params)
+        } catch (e: IllegalArgumentException) {
+            if (BuildConfig.DEBUG) throw e
+        }
+    }
+
     override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
         super.onPictureInPictureModeChanged(isInPictureInPictureMode)
         service?.mediaplayer?.updateVideoSurfaces()



More information about the Android mailing list