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