Video
A widget that plays a video from an URL.
Import this type with “”
Pauses the video. state changes to pause
and speed
to 0
. Has no effect when is not play
.
play(speed)
Parameters:
seek(position)
Parameters:
- position: number
- desired position in milliseconds.
Attempts to change theposition
to the given time index. Success depends on the currently loaded video. Has no effect if the current state isempty
or .
- desired position in milliseconds.
autoPlay
Type: boolean, default: true
If set to true
, starts playing the video as soon as the state changes from open
to ready
.
controlsVisible
Type: boolean, default: true
If set to true
, overlays the video with a native UI for controlling playback.
read-only Type: number
Returns the full length of the current video in milliseconds.
position
read-only Type: number
Returns the current playback position in milliseconds. This property does not trigger any change events.
speed
Returns the current playback speed. The value 1
represents the natural speed of the video. When the of the widget is not play
this property always has the value 0
.
state
read-only Type: string, supported values: , open
, ready
, play
, stale
, pause
, finish
, fail
, default: empty
The current state of the widget.
url
Type: string
The URL of the video to play. Setting this property to any non-empty string changes the state to open
and the video starts loading. Setting this property to an empty string unloads the current video and the returns to .
Fired when the autoPlay property has changed.
Event Parameters
target: this The widget the event was fired on.
value: boolean The new value of autoPlay.
controlsVisibleChanged
Fired when the controlsVisible property has changed.
Event Parameters
value: boolean The new value of controlsVisible.
durationChanged
Fired when the duration property has changed.
Event Parameters
target: this The widget the event was fired on.
positionChanged
Fired when the property has changed.
Event Parameters
target: this The widget the event was fired on.
value: number The new value of .
speedChanged
Fired when the property has changed.
Event Parameters
value: number The new value of .
Fired when the state property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of state.
urlChanged
Fired when the url property has changed.
Event Parameters
target: this The widget the event was fired on.
value: string The new value of url.
原文: