title: VideoContext

sidebar_label: VideoContext

Methods

exitFullScreen

Exits the full screen

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.exitFullScreen ✔️ ✔️

hideStatusBar

Hides the status bar (only effective in full screen mode on iOS)

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.hideStatusBar ✔️

pause

Pauses the video.

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.pause ✔️ ✔️

play

Plays the video.

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.play ✔️ ✔️

playbackRate

Sets multi-speed playback.

Reference

  1. (rate: number) => void
Property Type Description
rate number Indicates the playback speed (0.5x/0.8x/1x/1.25x/1.5x). 2.0x is supported as of V2.6.3.

API Support

API WeChat Mini-Program H5 React Native
VideoContext.playbackRate ✔️ ✔️

requestFullScreen

Enters the full screen.

Reference

  1. (option: RequestFullScreenOption) => void
Property Type
option RequestFullScreenOption

API Support

API WeChat Mini-Program H5 React Native
VideoContext.requestFullScreen ✔️ ✔️

seek

Jumps to the specific position.

Reference

  1. (position: number) => void
Property Type Description
position number The position to be jumped to (in sec)

API Support

API WeChat Mini-Program H5 React Native
VideoContext.seek ✔️ ✔️

sendDanmu

Sends barrage comments

Reference

  1. (data: Danmu) => void
Property Type Description
data Danmu Barrage comment text

API Support

API WeChat Mini-Program H5 React Native
VideoContext.sendDanmu ✔️

showStatusBar

Displays the status bar (only effective in full screen mode on iOS)

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.showStatusBar ✔️

stop

Stops the video.

Reference

  1. () => void

API Support

API WeChat Mini-Program H5 React Native
VideoContext.stop ✔️ ✔️

Parameters

RequestFullScreenOption

Property Type Required Description
direction 0 | 90 | -90 No Specifies the direction of the video in the full screen. If it is not specified, the direction is set automatically based on the aspect ratio.

Danmu

Barrage comments

Property Type Required Description
text string Yes Barrage comment text
color string No Color of barrage comments

API Support

API WeChat Mini-Program H5 React Native
VideoContext.exitFullScreen ✔️ ✔️
VideoContext.hideStatusBar ✔️
VideoContext.pause ✔️ ✔️
VideoContext.play ✔️ ✔️
VideoContext.playbackRate ✔️ ✔️
VideoContext.requestFullScreen ✔️ ✔️
VideoContext.seek ✔️ ✔️
VideoContext.sendDanmu ✔️
VideoContext.showStatusBar ✔️
VideoContext.stop ✔️ ✔️