diff --git a/en/react-native-video.md b/en/react-native-video.md index cf570673d6e93adcbbf4cc8697361bcd9e78e0a0..ba61dbc1cf2fb08f8078df22b75b09ed4a27e015 100644 --- a/en/react-native-video.md +++ b/en/react-native-video.md @@ -59,6 +59,7 @@ function RNCVideoDemo() { const [resizeMode, setResizeMode] = useState("none"); const [posterResizeMode, setPosterResizeMode] = useState("cover"); const [seekSec, setSeekSec] = useState(5000); + const [controls, setControls] = useState(false); const [onVideoLoad, setOnVideoLoad] = useState("onVideoLoad"); const [onVideoLoadStart, setOnVideoLoadStart] = useState("onVideoLoadStart"); @@ -87,6 +88,10 @@ function RNCVideoDemo() { setDisableFocus((prevDisableFocus) => !prevDisableFocus); }; + const toggleControls = () => { + setControls((prevControls) => !prevControls); + }; + const firstVideo = () => { setUri((prevRepeat) => "https://vjs.zencdn.net/v/oceans.mp4"); }; @@ -237,6 +242,7 @@ function RNCVideoDemo() { > muted:{muted.toString()} + { toggleControls() }} >controls:{controls.toString()} { @@ -262,6 +268,7 @@ function RNCVideoDemo() { ref={videoRef} source={{ uri: uri, isNetwork: true }} paused={paused} + controls={controls} muted={muted} resizeMode={resizeMode} repeat={repeat} @@ -595,7 +602,7 @@ Check the release version information in the release address of the third-party | `onPlaybackResume` | The callback when the buffer ends caching, controlling the hiding of the loading view | boolean | No | Android | No | | `automaticallyWaitsToMinimizeStalling` | A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. For clients linked against iOS 10.0 and later | boolean | No | iOS | No | | `bufferConfig` | Adjust the buffer settings. This prop takes an object with one or more of the properties listed below. | object | No | Android | No | -| `controls` |Determines whether to show player controls. | boolean | No | All | No | +| `controls` |Determines whether to show player controls. | boolean | No | All | Yes | | `currentPlaybackTime` |When playing an HLS live stream with a EXT-X-PROGRAM-DATE-TIME tag configured, then this property will contain the epoch value in msec.| string | No | All | No | | `filter` |Add video filter| string | No | iOS | No | | `filterEnabled` |Enable video filter.| string | No | iOS | No | diff --git a/zh-cn/react-native-video.md b/zh-cn/react-native-video.md index 2792fb9fa34d8de304836ff572982d339bd1a13a..8b5fc86fd00545d556ee328e6d6f403bc2fb0dbf 100644 --- a/zh-cn/react-native-video.md +++ b/zh-cn/react-native-video.md @@ -49,6 +49,7 @@ function RNCVideoDemo() { const [muted, setMuted] = useState(true); const [paused, setPaused] = useState(false); const [repeat, setRepeat] = useState(true); + const [controls, setControls] = useState(false); const [disableFocus, setDisableFocus] = useState(false); const [uri, setUri] = useState( "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4" @@ -73,6 +74,10 @@ function RNCVideoDemo() { setMuted((prevMuted) => !prevMuted); }; + const toggleControls = () => { + setControls((prevControls) => !prevControls); + }; + const togglePaused = () => { setPaused((prevPaused) => !prevPaused); }; @@ -235,6 +240,7 @@ function RNCVideoDemo() { > muted:{muted.toString()} + { toggleControls() }} >controls:{controls.toString()} { @@ -262,6 +268,7 @@ function RNCVideoDemo() { paused={paused} muted={muted} resizeMode={resizeMode} + controls={controls} repeat={repeat} volume={1} disableFocus={disableFocus} @@ -594,7 +601,7 @@ ohpm install | `onPlaybackResume` | The callback when the buffer ends caching, controlling the hiding of the loading view | boolean | No | Android | No | | `automaticallyWaitsToMinimizeStalling` | A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. For clients linked against iOS 10.0 and later | boolean | No | iOS | No | | `bufferConfig` | Adjust the buffer settings. This prop takes an object with one or more of the properties listed below. | object | No | Android | No | -| `controls` |Determines whether to show player controls. | boolean | No | All | No | +| `controls` |Determines whether to show player controls. | boolean | No | All | Yes | | `currentPlaybackTime` |When playing an HLS live stream with a EXT-X-PROGRAM-DATE-TIME tag configured, then this property will contain the epoch value in msec.| string | No | All | No | | `filter` |Add video filter| string | No | iOS | No | | `filterEnabled` |Enable video filter.| string | No | iOS | No |