disable interaction
This commit is contained in:
+4
-3
@@ -3,6 +3,7 @@ package ru.shadowsparky.videoplayer.ui
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.annotation.OptIn
|
||||
@@ -58,20 +59,20 @@ actual fun VideoCanvas(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
useController = false
|
||||
|
||||
focusable = View.NOT_FOCUSABLE
|
||||
defaultFocusHighlightEnabled = false
|
||||
resizeMode = when (scaleType) {
|
||||
VideoScaleType.FIT -> AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||
VideoScaleType.FULL -> AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
||||
VideoScaleType.STRETCH -> AspectRatioFrameLayout.RESIZE_MODE_FILL
|
||||
}
|
||||
|
||||
keepScreenOn = true
|
||||
context.updatePipAutoEnter(this, true)
|
||||
}
|
||||
},
|
||||
update = { playerView ->
|
||||
playerView.defaultFocusHighlightEnabled = false
|
||||
if (playerView.player != androidController.getPlayerInstance()) {
|
||||
playerView.player = androidController.getPlayerInstance()
|
||||
}
|
||||
|
||||
+5
-3
@@ -107,9 +107,11 @@ fun VideoPlayer(
|
||||
false
|
||||
}
|
||||
} else {
|
||||
modifier.clickable {
|
||||
areControlsVisible = !areControlsVisible
|
||||
}
|
||||
modifier.clickable(
|
||||
interactionSource = null,
|
||||
indication = null,
|
||||
onClick = { areControlsVisible = !areControlsVisible }
|
||||
)
|
||||
}
|
||||
|
||||
Box(modifier = rootModifier.background(Color.Black)) {
|
||||
|
||||
Reference in New Issue
Block a user