mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Merge pull request #3810 from Isira-Seneviratne/PIP_exception
Avoid possible PIP-related exception on API levels below 33.
This commit is contained in:
commit
ee21ac1a67
@ -4,7 +4,6 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
|
||||
object PictureInPictureCompat {
|
||||
fun isPictureInPictureAvailable(context: Context): Boolean {
|
||||
@ -18,7 +17,6 @@ object PictureInPictureCompat {
|
||||
|
||||
fun setPictureInPictureParams(activity: Activity, params: PictureInPictureParamsCompat) {
|
||||
if (isPictureInPictureAvailable(activity)) {
|
||||
if (params.toPictureInPictureParams().actions.isEmpty()) throw IllegalArgumentException()
|
||||
activity.setPictureInPictureParams(params.toPictureInPictureParams())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user