Skip to main content

bn.createVideoContext

createVideoContext(id): VideoContext

description create video context VideoContext Object. Recommended use bn.createSelectorQuery Obtain context Object

example

 const videoContextCurrent = bn.createVideoContext('test-id')

Parameters

NameType
idstring

Returns

VideoContext

VideoContext

Interface: VideoContext#

NameTypeDescription
exitBackgroundPlayback(): voidExit background audio playback mode.
exitFullScreen(): voidExit Full Screen.
exitPictureInPicture(option?): voidExit window, which can be called on any page.
hideStatusBar(): voidHide the status bar, only available in full iOS screen.
pause(): voidPause video.
play(): voidPlay the video.
playbackRate(rate): voidSet playback speed.
requestBackgroundPlayback(): voidEnter background audio playback mode.
requestFullScreen(option): voidGo to full screen. If you have custom content that needs to be displayed at full screen, place the content node in the video Node.
seek(position): voidJump to the specified location.
showStatusBar(): voidDisplay status bar, valid for iOS full screen only.
stop(): voidStop the video.

exitBackgroundPlayback#

exitBackgroundPlayback(): void

Exit background audio playback mode.

Returns

void


exitFullScreen#

exitFullScreen(): void

Exit Full Screen.

Returns

void


exitPictureInPicture#

exitPictureInPicture(option?): void

Exit window, which can be called on any page.

Parameters

NameType
option?ExitPictureInPictureOption

Returns

void


hideStatusBar#

hideStatusBar(): void

Hide the status bar, only available in full iOS screen.

Returns

void


pause#

pause(): void

Pause video.

Returns

void


play#

play(): void

Play the video.

Returns

void


playbackRate#

playbackRate(rate): void

Set playback speed.

Parameters

NameType
ratenumber

Returns

void


requestBackgroundPlayback#

requestBackgroundPlayback(): void

Enter background audio playback mode.

Returns

void


requestFullScreen#

requestFullScreen(option): void

Go to full screen. If you have custom content that needs to be displayed at full screen, place the content node in the video Node.

Parameters

NameType
optionVideoContextRequestFullScreenOption

Returns

void


seek#

seek(position): void

Jump to the specified location.

Parameters

NameType
positionnumber

Returns

void


showStatusBar#

showStatusBar(): void

Display status bar, valid for iOS full screen only.

Returns

void


stop#

stop(): void

Stop the video.

Returns

void

Interface: ExitPictureInPictureOption#

NameTypeDescription
complete?(res): void
fail?(res): void
success?(res): void

complete#

Optional complete(res): void

Parameters

NameType
resGeneralCallbackResult

Returns

void


fail#

Optional fail(res): void

Parameters

NameType
resGeneralCallbackResult

Returns

void


success#

Optional success(res): void

Parameters

NameType
resGeneralCallbackResult

Returns

void

Interface: GeneralCallbackResult#

NameTypeDescription
errMsgstring

Interface: VideoContextRequestFullScreenOption#

NameTypeDescription
direction?0 | 90 | -90Set the direction of the video at full screen. If not specified, it will be judged automatically according to the aspect ratio.; object.direction Legal value; 0: Normal vertical; 90: The screen is 90 degrees counterclockwise; -90: Screen 90 degrees clockwise