mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-08-16 02:56:22 +00:00
fix(android): cannot disable native controls
This commit is contained in:
+5
-1
@@ -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,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",
|
||||
|
||||
Reference in New Issue
Block a user