# Video

The video object.

# Properties

# number x

The x-coordinate of the top-left corner of the video.

# number y

The y-coordinate of the top-left corner of the video.

# number width

The width of the video.

# number height

The height of the video.

# number src

The resource address of the video.

# number poster

The cover of the video.

# number initialTime

The initial time point at which the video starts to play (in sec).

# number playbackRate

The video playback speed. Available values include 0.5, 0.8, 1.0, 1.25, and 1.5.

# number live

Indicates whether it is live stream.

# number objectFit

The zoom mode of the video.

# number controls

Specifies whether to display controls for the video.

# number autoplay

Specifies whether to enable auto playback for the video.

# number loop

Specifies whether to enable loop playback for the video.

# number muted

Specifies whether the video is muted during playback.

# boolean enableProgressGesture

Specifies whether to enable gesture control of playback progress.

# boolean showCenterPlayBtn

Specifies whether to display the play button in the center of the video.

# function onwaiting

The callback function triggered when the video starts buffering.

# function onplay

The callback function triggered when the video starts playing.

# function onpause

The callback function triggered when the video is paused.

# function onended

The callback function triggered when the video playback is complete.

# function ontimeupdate

The callback function triggered whenever the video playback progress updates.

# function onerror

The callback function triggered when an error occurs in the video.

# Methods

# Video.destroy()

Deletes the video.

# Promise Video.play()

Plays the video.

# Promise Video.pause()

Pauses the video.

# Promise Video.stop()

Stops the video.

# Promise Video.seek(number time)

Drags the video progress bar.

# Promise Video.requestFullScreen()

Displays the video in full screen.

# Promise Video.exitFullScreen()

Exits the full screen.

# Video.onWaiting(function callback)

Listens on the video buffering event.

# Video.offWaiting(function callback)

Un-listens on the video buffering event.

# Video.onPlay(function callback)

Listens on the video playback event.

# Video.offPlay(function callback)

Un-listens on the video playback event.

# Video.onPause(function callback)

Listens on the video pause event.

# Video.offPause(function callback)

Un-listens on the video pause event.

# Video.onEnded(function callback)

Listens on the video playback completion event.

# Video.offEnded(function callback)

Un-listens on the video playback completion event.

# Video.onTimeUpdate(function callback)

Listens on the video playback progress update event.

# Video.offTimeUpdate(function callback)

Un-listens on the video playback progress update event.

# Video.onError(function callback)

Listens on the video error event.

# Video.offError(function callback)

Un-listens on the video error event.

点击咨询小助手