fix(android): cannot disable native controls

This commit is contained in:
Krzysztof Moch
2025-04-30 16:04:17 +02:00
parent afce52c88f
commit 35375f47d5
3 changed files with 16 additions and 3 deletions
@@ -62,7 +62,11 @@ class HybridVideoViewViewManager(nitroId: Int): HybridVideoViewViewManagerSpec()
videoView.get()?.pictureInPictureEnabled = value
}
override var controls: Boolean = false
override var controls: Boolean
get() = videoView.get()?.useController == true
set(value) {
videoView.get()?.useController = value
}
override val memorySize: Long
get() = 0
@@ -25,6 +25,7 @@ import com.video.core.activities.FullscreenVideoViewActivity
import com.video.core.fragments.PictureInPictureHelperFragment
import com.video.core.utils.PictureInPictureUtils.canEnterPictureInPicture
import com.video.core.utils.PictureInPictureUtils.createPictureInPictureParams
import com.video.core.utils.Threading.runOnMainThread
@UnstableApi
class VideoView @JvmOverloads constructor(
@@ -68,13 +69,21 @@ class VideoView @JvmOverloads constructor(
}
}
var useController: Boolean = true
var useController: Boolean = false
set(value) {
field = value
runOnMainThread {
playerView.useController = value
}
}
var pictureInPictureEnabled: Boolean = false
var onNitroIdChange: ((Int?) -> Unit)? = null
var playerView = PlayerView(context).apply {
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
setShutterBackgroundColor(Color.TRANSPARENT)
useController = false
}
var isInFullscreen: Boolean = false
var isInPictureInPicture: Boolean = false
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-native-video",
"version": "7.0.0-dev.1",
"version": "7.0.0-dev.2",
"description": "<Video /> Component for React Native",
"source": "./src/index.tsx",
"main": "./lib/commonjs/index.js",