Skip to main content
Version: 3.x

VideoContext

Methods

exitFullScreen

Exits the full screen

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.exitFullScreen✔️✔️

hideStatusBar

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

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.hideStatusBar✔️

pause

Pauses the video.

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.pause✔️✔️

play

Plays the video.

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.play✔️✔️

playbackRate

Sets multi-speed playback.

Reference

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

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.playbackRate✔️✔️

requestFullScreen

Enters the full screen.

Reference

(option: RequestFullScreenOption) => void
PropertyType
optionRequestFullScreenOption

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.requestFullScreen✔️✔️

seek

Jumps to the specific position.

Reference

(position: number) => void
PropertyTypeDescription
positionnumberThe position to be jumped to (in sec)

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.seek✔️✔️

sendDanmu

Sends barrage comments

Reference

(data: Danmu) => void
PropertyTypeDescription
dataDanmuBarrage comment text

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.sendDanmu✔️

showStatusBar

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

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.showStatusBar✔️

stop

Stops the video.

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.stop✔️✔️

Parameters

RequestFullScreenOption

PropertyTypeRequiredDescription
direction0 | 90 | -90NoSpecifies 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

PropertyTypeRequiredDescription
textstringYesBarrage comment text
colorstringNoColor of barrage comments

API Support

APIWeChat Mini-ProgramH5React Native
VideoContext.exitFullScreen✔️✔️
VideoContext.hideStatusBar✔️
VideoContext.pause✔️✔️
VideoContext.play✔️✔️
VideoContext.playbackRate✔️✔️
VideoContext.requestFullScreen✔️✔️
VideoContext.seek✔️✔️
VideoContext.sendDanmu✔️
VideoContext.showStatusBar✔️
VideoContext.stop✔️✔️