This topic describes the properties, methods, and events that Aliplayer supports.
If you encounter any problems, see Web player FAQ or Troubleshoot playback exceptions.
Properties
When you initialize Aliplayer, you can set various properties. These include properties for the license, playback resources, player style, and playback behavior.
Name | Type | Description |
id | String | The DOM element ID of the outer container of the player. |
source | String | When you use URL-based playback, use the source property to specify the video playback URL. Note
|
vid | String | The media ID in ApsaraVideo Media Processing. |
playauth | String | The playback credential. To obtain a playback credential, see Obtain audio and video playback credentials. |
customVodServer | String | A custom VOD proxy domain name. This property is applicable to the VidAuth playback method in versions 2.32.0 and later. You must deploy a dedicated request proxy service. If the default VOD domain name (*.aliyuncs.com) is inaccessible, the player automatically falls back to your proxy service. This can effectively mitigate carrier hijacking risks and significantly improve playback stability and success rate. |
playConfig | JSON | A custom settings field for Vid-based playback (VidAuth and VidSts). The settings are passed through to the VOD API. For information about the supported custom fields and their descriptions, see Custom media playback settings (PlayConfig). The following code provides a value example: |
authTimeout | Number | The validity period of the video playback URL obtained through Vid-based playback (VidAuth and VidSts). Unit: seconds. Default value: 7200. Make sure that this period is longer than the actual video duration to prevent the playback URL from expiring before playback is complete. |
height | String | The player height. Valid values:
|
width | String | The player width. Valid values:
|
autoSize | Boolean | String | The player size automatically adapts to the video content. Valid values: 'height', 'width'. For example, you can specify `width: '500px', autoSize: 'height'`. The player maintains a width of 500px and automatically adjusts the height based on the actual video aspect ratio. Alternatively, you can specify `height: '500px', autoSize: 'width'`. The player maintains a height of 500px and automatically adjusts the width based on the actual video aspect ratio. Note: `autoSize: true` is equivalent to `autoSize: 'height'`, which means the height is adaptive by default. |
videoWidth | String | The video width. For more information, see Set the display mode. |
videoHeight | String | The video height. For more information, see Set the display mode. |
preload | Boolean | The player automatically loads the video. |
cover | String | The default thumbnail of the player. Enter a valid image URL. This property takes effect only when `autoplay` is set to false. |
isLive | Boolean | Specifies whether the content is a live stream. If it is, the player prevents users from dragging the progress bar. The default value is false. Set this to true when playing a live stream. |
autoplay | Boolean | Specifies whether the player autoplays the video. The autoplay property is not effective on mobile devices. Valid values:
Note Due to browser restrictions, the Web Player SDK may fail to autoplay videos in some scenarios. For more information, see Advanced features. |
autoplayPolicy | Object | The adaptive muted autoplay policy for the player. This property takes effect only when Note
|
rePlay | Boolean | The player automatically loops the playback. |
useH5Prism | Boolean | Specifies whether to use the H5 player. |
playsinline | Boolean | Specifies whether to play the video inline in H5. This may not work on some Android browsers. |
skinRes | Url | The skin image. We recommend that you do not modify this field. To make changes, see Set the player skin. |
skinLayout | Array | Boolean | The layout configuration for functional components. If you do not specify this field, the default layout is used. A value of `false` hides all functional components. For more information, see Configure the skinLayout property. |
skinLayoutIgnore | Array | The UI components to hide. For component names, see VOD component parameters. The following code provides a configuration example: Note The `skinLayoutIgnore` property has a higher priority than the `skinLayout` property. |
controlBarVisibility | String | The implementation of the control panel. The valid values are:
|
showBarTime | Number | The time in milliseconds before the control bar automatically hides. |
enableSystemMenu | Boolean | Specifies whether to show the system's right-click menu. The default value is false. |
format | String | Specifies the format of the playback URL. Valid values:
The default value is empty. |
mediaType | String | Specifies whether to return audio or video. This is supported only when you use the `vid` playback method. The default value is video. Valid values:
|
qualitySort | String | Specifies the sorting order. This is supported only when you use the Vid + PlayAuth playback method. Valid values:
Default value: asc. |
definition | String | The video definitions to display, separated by commas (,). For example, 'FD,LD'. This value is a subset of the definitions available for the `vid`. Valid values:
|
defaultDefinition | String | The default video definition. This value must be one of the definitions available for the `vid`. Valid values:
|
autoPlayDelay | Number | The delay before playback starts. Unit: seconds. |
language | String | The language for internationalization. The default value is zh-cn. If not set, the browser's language is used. Valid values:
|
languageTexts | JSON | A JSON object for custom internationalization text. The key must correspond to the value of the `language` property. Example: {jp:{Play:"Play"}}. For the JSON structure, see JSON structure. |
snapshotWatermark | Object | Sets a watermark for screenshots in H5. |
useHlsPluginForSafari | Boolean | Specifies whether to enable the HLS plugin for playback in Safari browsers, except for Safari 11. Valid values:
|
enableStashBufferForFlv | Boolean | When playing FLV streams in H5, specifies whether to enable the playback cache. This works only for live streaming. Valid values:
|
stashInitialSizeForFlv | Number | When playing FLV streams in H5, this is the initial cache size. This works only for live streaming. The default is 32 KB. A smaller value can speed up the initial playback, but if the value is too small, it may cause stuttering after a short period of playback. |
loadDataTimeout | Number | The buffering duration in seconds after which the player prompts the user to switch to a lower definition. The default is 20 seconds. |
waitingTimeout | Number | The maximum buffering timeout period. If this period is exceeded, an error is prompted. Unit: seconds. The default is 60 seconds. |
diagnosisButtonVisible | Boolean | Specifies whether to display the diagnosis button. Valid values:
|
disableSeek | Boolean | Disables seeking on the progress bar. Valid values:
|
encryptType | Number | Specifies whether to play videos encrypted with Alibaba Cloud private encryption. The default value is 0. Valid values:
Note
|
progressMarkers | Array | An array of content for marking the progress bar. For more information, see Progress bar markers. |
vodRetry | Number | The number of retry attempts for failed VOD playback. The default is 3. |
liveRetry | Number | The number of retry attempts for failed live playback. The default is 5. |
hlsFrameChasing | Boolean | In HLS live streaming mode, specifies whether to enable frame synchronization. Valid values:
Note This parameter is supported only in Web Player SDK versions earlier than 2.21.0. For versions 2.21.0 and later, to set frame synchronization in HLS live streaming mode, see the |
chasingFirstParagraph | Number | The duration of the first frame synchronization segment. Unit: seconds. The default is 20 seconds. Note This parameter is supported only in Web Player SDK versions earlier than 2.21.0. For versions 2.21.0 and later, to set frame synchronization in HLS live streaming mode, see the |
chasingSecondParagraph | Number | The duration of the second frame synchronization segment. Unit: seconds. The default is 40 seconds. Note This parameter is supported only in Web Player SDK versions earlier than 2.21.0. For versions 2.21.0 and later, to set frame synchronization in HLS live streaming mode, see the |
chasingFirstSpeed | Number | The playback speed for the first frame synchronization segment. The default is 1.1x. Note This parameter is supported only in Web Player SDK versions earlier than 2.21.0. For versions 2.21.0 and later, to set frame synchronization in HLS live streaming mode, see the |
chasingSecondSpeed | Number | The playback speed for the second frame synchronization segment. The default is 1.2x. Note This parameter is supported only in Web Player SDK versions earlier than 2.21.0. For versions 2.21.0 and later, to set frame synchronization in HLS live streaming mode, see the |
hlsOption.maxLiveSyncPlaybackRate | Number | In HLS live streaming mode, sets the playback speed for live frame synchronization. The default is 1, which means frame synchronization is disabled.
Note This parameter is supported only in Web Player SDK 2.21.0 and later. |
flvFrameChasing | Boolean | In FLV live streaming mode, specifies whether to enable frame synchronization. Valid values:
The default value is false. |
keyShortCuts | Boolean | Specifies whether to enable keyboard shortcuts. Valid values:
The default value is false. Note The left and right arrow keys control fast backward and fast forward. The up and down arrow keys control the volume. The space bar pauses and resumes playback. |
keyFastForwardStep | Number | The time increment for fast forward and fast backward. Unit: seconds. The default is 10 seconds. |
rtsFallback | Boolean | When the browser does not support RTS or RTS stream pulling fails, the player automatically tries to fall back to FLV or HLS for playback. It prioritizes FLV for lower latency. If the browser does not support FLV, it falls back to HLS. This feature is enabled by default. To disable it, you can pass `false`. |
rtsFallbackType | String | Specifies the protocol to fall back to from RTS. Valid values are HLS or FLV. If you do not pass this parameter, the player automatically selects a protocol. It prioritizes FLV for lower latency. If the browser does not support FLV, it falls back to HLS. |
rtsFallbackSource | String | We recommend that you use the player's default fallback policy. However, if you want to specify a fixed stream pulling URL for fallback, use this parameter. |
traceId | String | The `traceId` is your own unique user identifier. Pass the `traceId` to the public instrumentation for tracking reported logs. By default, the Web Player SDK has log reporting enabled. Passing a `traceId` helps you identify users. If you do not pass it, the Web Player SDK generates a UUID (a unique identifier generated by the player SDK) and stores it in the browser cache. Note Supported in Web Player SDK 2.10.0 and later. |
textTracks | Array | Sets WebVTT external captions. The following code provides an example: Field descriptions:
Note
|
ratio | Number | Sets the player to scale at a fixed aspect ratio. For example, if a video has a 16:9 aspect ratio, you can set the player parameters to |
extLanguageTexts | Object | The Player SDK has a built-in set of UI text in Chinese and English. You can use this property to customize the display text for parts of the UI. For example, to change the display text for the HD resolution, which defaults to 高清 (High Definition), you can change it to 1080p as follows: |
speedLevels | Array | Sets a custom playback speed list array. `key` represents the speed value, and `text` represents the UI text. If not passed, the default list is used. The following code provides a parameter value example: |
logo | Array | Sets a custom logo image. The following code provides an example: Field descriptions:
|
license | Object | To use value-added services such as Playback Quality Monitoring (Old Version), Single-point tracing, and playing H.265/H.266 encoded video streams, first fill out the Web Player SDK Value-added Service Application Form to apply for a license. Then, integrate the license as follows: |
mute | Boolean | Sets whether to play the video on mute. When browsers prohibit autoplay, you can configure this parameter for muted autoplay. For more information, see Advanced features. |
clickPause | Boolean | Click the video screen to pause or play.
The default value is `true` on PCs and `false` on mobile devices. Do not use this property with the `dbClickSkip` property to avoid interaction conflicts. |
disablePip | Boolean | Hides the browser's native Picture-in-Picture (PiP) button. Note
|
env | String | The player's instrumentation data is uploaded to the China data center by default. If you have data compliance requirements for regions outside China, pass the parameter `env: 'SEA'`. The data will be uploaded to the Singapore data center. |
watchStartTime | Number | Used alone, it represents the start time of playback. Used with `watchEndTime`, it enables range playback, allowing playback and seeking only within the specified start and end times. Unit: seconds |
watchEndTime | Number | Used with `watchStartTime` to enable range playback, allowing playback and seeking only within the specified start and end times. If this parameter's value is less than `watchStartTime`, `watchStartTime` becomes invalid. Unit: seconds |
start | Number | Used with `end` to clip a part of the video and treat it as a separate video. For example, for a 60-second video, setting `start:10` and `end:30` results in a video with a displayed duration of 20 seconds, starting playback from the 10-second mark of the original video. |
end | Number | Used with `start` to clip a part of the video and treat it as a separate video. For example, for a 60-second video, setting `start:10` and `end:30` results in a video with a displayed duration of 20 seconds, starting playback from the 10-second mark of the original video. |
dbClickFullscreen | Boolean | Specifies whether to enable double-click to enter full screen. This is enabled by default on PCs. |
longPressFastForward | Boolean | The long-press for fast-forward feature (mobile only). Valid values:
|
dbClickSkip | Boolean | The double-click to skip feature (mobile only), where double-clicking the left area fast-backwards and the right area fast-forwards. Valid values:
Do not use this property with the `clickPause` property to avoid interaction conflicts. |
enableMockFullscreen | Boolean | Web page full screen feature. The player calls the browser's full screen API by default. On iOS browsers and some Android browsers, full screen mode is taken over by the system player, which can cause issues like the UI disappearing. To prevent this, you can enable this parameter to implement a pseudo-full screen using CSS. The default value is false. |
Methods
Methods must be called after the `ready` event occurs. You can call methods within the `ready` callback function of the player constructor. The following code provides an example:
// Method 1:
var player = new Aliplayer({}, function (player) {
player.play();
});
// Method 2:
var player = new Aliplayer({});
function handleReady(player) {
player.play();
};
player.on('ready', handleReady);The following methods can be called on an Aliplayer instance:
play()
Plays the video.
Function definition
() => Playerpause()
Pauses the video.
(showPlayButton?: boolean) => PlayerParameters
Name | Parameter type | Required | Description |
showPlayButton | Boolean | No | Specifies whether to show the play button. |
replay()
Replays the video.
Function definition
() => Playerseek()
Seeks to a specific time for playback.
Function definition
(time: number) => Player Parameters
Name | Parameter type | Required | Description |
time | number | Yes | The time to seek to. Unit: seconds. |
dispose()
Destroys the player.
Function definition
() => voidgetCurrentTime()
Retrieves the current playback time. The returned value is in seconds.
Function definition
() => numbergetDuration()
Retrieves the total duration of the video in seconds. This method can be called after the video is loaded, such as after the `play` event occurs.
Function definition
() => numbergetVolume()
Retrieves the current volume. The returned value is a real number from 0 to 1. This feature may not be supported on iOS or some Android devices.
Function definition
() => number | undefinedsetVolume()
Sets the volume.
Function definition
(volume: number) => voidParameters
Name | Parameter type | Required | Description |
volume | number | Yes | vol is a real number from 0 To 1. This may not work on iOS and some Android devices. |
mute()
Mutes the player.
Function definition
(quiet?: boolean) => PlayerParameters
Name | Parameter type | Required | Description |
quiet | boolean | No | Specifies whether to hide the text prompt in the lower-left corner when muting. |
unMute()
Unmutes the player.
Function definition
(quiet?: boolean) => PlayerParameters
Name | Parameter type | Required | Description |
quiet | boolean | No | Specifies whether to hide the text prompt in the lower-left corner when unmuting. |
getPlayTime()
Retrieves the user's actual playback duration in seconds. This duration excludes time when the video is paused and accounts for the physical time elapsed during speed changes.
Function definition
() => numberloadByUrl()
Loads a new video by URL. This method supports switching between videos of the same format, such as MP4, HLS, or FLV. To switch between videos of different formats, you must destroy the current player instance and create a new one.
Function definition
(url: string, seconds?: number, autoPlay?: boolean) => voidParameters
Name | Parameter type | Required | Description |
url | string | Yes | The URL of the video to switch to. |
seconds | number | No | The starting position after switching. |
autoPlay | boolean | No | Specifies whether to autoplay after switching. |
replayByVidAndPlayAuth()
VOD supports switching between videos of the same format only.
Function definition
(vid: string, playauth: string) => voidParameters
Name | Parameter type | Required | Description |
vid | string | Yes | The video ID. |
playauth | string | Yes | The playback credential. |
replayByVidAndAuthInfo()
Replays an ApsaraVideo Media Processing (MPS) video. This method only supports switching between videos of the same format.
Function definition
(vid: string, accId: string, accSecret: string, stsToken: string, authInfo: string, domainRegion: string) => voidFor more information, see MPS playback.
replayByMediaAuth()
Replays a video from a general media service. This method only supports switching between videos of the same format.
Function definition
(mediaAuth: string) => voidParameters
Name | Parameter type | Required | Description |
mediaAuth | string | Yes | The playback credential. |
getBuildInComponent()
Retrieves a built-in UI component, such as the full-screen button or the progress bar.
Function definition
(name: string) => BuildInComponent;Parameters
Name | Parameter type | Required | Description |
name | string | Yes | For the names of built-in components (such as `fullScreenButton`), see Configure the skinLayout property. Each component supports `hide()` and `show()` methods to control its visibility. |
setPlayerSize()
Sets the player size.
Function definition
(width: string, height: string) => voidParameters
Name | Parameter type | Required | Description |
width | string | Yes | Sets the player size. Valid values:
|
height | string | Yes |
setSpeed()
Sets the playback speed. This feature may not be supported on some mobile devices, such as on WeChat for Android. By default, the playback speed UI is enabled.
Function definition
(speed: number) => voidParameters
Name | Parameter type | Required | Description |
speed | number | Yes | Supports playback speeds from 0.5x to 2x. |
How to disable playback speed control:
You cannot disable or customize the speed options individually. You can only disable the entire settings menu.
A workaround to disable the speed control is to override the style:
.prism-setting-speed { display: none !important; }
setTraceId()
Passes a value to the public instrumentation for log tracking.
Function definition
(traceId: string) => voidParameters
Name | Parameter type | Required | Description |
traceId | string | Yes | A unique identifier. |
This feature is supported in Web Player SDK 2.10.0 and later.
setSanpshotProperties()
Sets snapshot parameters.
Function definition
(width: number, height: number, rate: number) => voidParameters
Name | Parameter type | Required | Description |
width | number | Yes | The height and width are in px. The screenshot quality is a number between 0 and 1, with a default of 1. For detailed information about video screenshots, see Video screenshots. |
height | number | Yes | |
rate | number | Yes |
fullscreenService.requestFullScreen()
Enters full-screen mode.
Function definition
() => PlayerfullscreenService.cancelFullScreen()
Exits full-screen mode. This call has no effect on iOS.
Function definition
() => PlayerfullscreenService.getIsFullScreen()
Retrieves the full-screen status of the player.
Function definition
() => booleangetStatus()
Retrieves the player status. The returned string value can be one of the following:
init: The player is initializing.
ready: The player is ready.
loading: Content is being loaded.
play: Starts playback.
pause: The video is paused.
playing: The video is playing.
waiting: The player is waiting for the buffer.
error: An error occurred.
Ended: The process is complete.
Function definition
() => stringliveShiftSerivce.setLiveTimeRange()
Sets the start and end times of a live stream. This method is used when the time shifting feature is enabled.
Function definition
(start: string, end: string) => voidParameters
Name | Parameter type | Required | Description |
start | string | Yes | start is the start time of the live stream. |
end | string | Yes | end is the end time of the live stream. |
Example
player.liveShiftSerivce.setLiveTimeRange('2025/03/21 12:43:00', '2025/03/21 23:31:00')setRotate()
Sets the rotation angle of the player.
Function definition
(rotate: number) => voidParameters
Name | Parameter type | Required | Description |
rotate | number | Yes | A positive number indicates clockwise rotation, and a negative number indicates counter-clockwise rotation. Example: `setRotate(90)`. For more information, see Set the display mode. |
getRotate()
Retrieves the rotation angle of the player.
Function definition
() => numberFor more information, see Set the display mode.
setImage()
Sets the image mirroring.
Function definition
(type: string) => voidParameters
Name | Parameter type | Required | Description |
type | string | Yes | Valid values:
Example: `setImage('horizon')`. For more information, see Set the display mode. |
setCover()
Sets the thumbnail.
Function definition
(coverUrl: string) => voidParameters
Name | Parameter type | Required | Description |
coverUrl | string | Yes | The thumbnail URL. |
setProgressMarkers()
Sets progress bar markers.
Function definition
(markers: Array<{ time: number, text: string }>) => voidParameters
Name | Parameter type | Required | Description |
markers | Array<markers> | Yes | markers: A collection of marker data. Required. marker.time: The time of the marker. Required. marker.text: The text for the marker. Required. For more information, see the `progressMarkers` parameter. |
setPreviewTime()
Sets the preview duration.
Function definition
(time: number) => voidParameters
Name | Parameter type | Required | Description |
time | number | Yes | Unit: seconds. For more information, see Preview. |
getPreviewTime()
Retrieves the preview duration.
Function definition
() => numberisPreview()
Checks whether the current playback is a preview.
Function definition
() => booleangetCurrentPDT()
For videos in HLS format, this method retrieves the real-time Program-Date-Time (PDT).
Function definition
() => number | undefinedsetTextTracks()
Sets a group of WebVTT captions.
Function definition
(textTracks: Array<{ kind: string, label: string, src: string, srclang: string }>) => voidParameters
Name | Parameter type | Required | Description |
textTracks | Array<object> | Yes | The following code provides an example: Note Supported in Web Player SDK 2.12.0 and later. |
setLogo()
Sets a custom logo image.
Function definition
(logoList: Array<{ width: number, position: string, origin: string, src: string }>) => voidParameters
Name | Parameter type | Required | Description |
logoList | Array<object> | Yes | The following code provides an example: For detailed descriptions of each field, see the `logo` property. |
setWatchTime()
Dynamically updates the `watchStartTime` and `watchEndTime` for the current video.
Function definition
(start: number, end: number) => voidParameters
Name | Parameter type | Required | Description |
start | string | Yes | start is the start time. |
end | string | Yes | end is the end time. |
setNextWatchTime()
Sets the `watchStartTime` and `watchEndTime` for the next video. If you plan to switch videos using `loadByUrl` or `replayByVidAndPlayAuth`, you can call this method to set the playback range for the next video.
Function definition
(start: number, end: number) => voidParameters
Name | Parameter type | Required | Description |
start | string | Yes | start is the start time. |
end | string | Yes | end is the end time. |
setStartEnd()
Dynamically updates the `start` and `end` times for the current video.
Function definition
(start: number, end: number) => voidParameters
Name | Parameter type | Required | Description |
start | string | Yes | start is the start time. |
end | string | Yes | end is the end time. |
setNextStartEnd()
Sets the `start` and `end` times for the next video. If you plan to switch videos using `loadByUrl` or `replayByVidAndPlayAuth`, you can call this method to set the clipping range for the next video.
Function definition
(start: number, end: number) => voidParameters
Name | Parameter type | Required | Description |
start | string | Yes | start is the start time. |
end | string | Yes | end is the end time. |
takeSnapshot()
Takes a snapshot. The returned base64 string can be directly loaded by `img.src`. You can use `setSnapshotProperties` to set the snapshot quality and `snapshotWatermark` to set a watermark.
Note: The snapshot feature may not be available on some mobile browsers, such as UC Browser or QQ Browser, where the video element is hijacked.
Function definition
() => { time: number, base64: string, binary: string, error: Error | null }Return value
Name | Parameter type | Description |
time | string | The time of the snapshot. |
base64 | string | The base64 content of the snapshot. |
binary | string | The snapshot content as a binary string. |
error | Error | Details of the snapshot exception. |
showControlBar()
Shows the control bar.
Function definition
() => voidhideControlBar()
Hides the control bar.
Function definition
() => voidEvents
Player events
Name | Description |
ready | The player's video initialization button has finished rendering. Initial UI settings for the player must be triggered after this event to prevent them from being overwritten by the initialization. Note The methods provided by the player can only be called after this event has occurred. |
play | Triggered when the video resumes playing from a paused state. |
pause | Triggered when the video is paused. |
canplay | Occurs when the audio and video can start playing. It can be triggered multiple times. This is for the H5 player only. |
playing | Triggered multiple times during playback. |
ended | Triggered when the current video finishes playing. |
liveStreamStop | Triggered when the live stream is interrupted. For HLS live streams, this is triggered after 5 unsuccessful retry attempts. It indicates to the upper layer that the stream is interrupted or the video needs to be reloaded. Note If an HLS live stream is interrupted or encounters an error, the player automatically retries 5 times. No retry logic needs to be added at the upper layer. |
onM3u8Retry | The retry event after an HLS live stream is interrupted. It is triggered only once per interruption. |
hideBar | The event for the control bar automatically hiding. |
showBar | The event for the control bar automatically showing. |
waiting | The data buffering event. |
timeupdate | Triggered when the playback position changes. You can get the current playback time using the `getCurrentTime` method. |
snapshoted | The snapshot completion event. |
requestFullScreen | The full screen event. |
cancelFullScreen | The exit full screen event. Not triggered on iOS. |
error | The error event. |
startSeek | Starts seeking. The parameter returns the time of the seek point. |
completeSeek | Completes seeking. The parameter returns the time of the seek point. |
resolutionChange | In a live stream, the ingest endpoint has switched the resolution. |
seiFrame | An SEI message is received for HLS or FLV. |
rtsFallback | Triggered when RTS falls back. The |
settingSelected | Triggered when an item in a settings list (such as playback speed, definition, or captions) is selected. Note Because the open-source playback speed plugin is not synchronized with the player settings, using it requires custom code and recompilation. You can define an event listener. To use the player's |
rtsTraceId | Triggered when RTS stream pulling is successful. By subscribing to this event, you can get the RTS TraceId. In the log printing, the `traceId` field in the |
autoplay | Triggered when autoplay succeeds or fails. The callback parameter |
mutedAutoplay | Triggered when muted autoplay is successful, if |
videoUnavailable | Triggered when the video playback results in a black screen because the video encoding format is not supported. For example, when playing an H.265 video in a browser that does not support H.265, the video screen is black, but the audio plays. This event is triggered in such cases. |
Subscribe to events
You can subscribe to events using the `on` method of the player instance. The following code provides an example:
function handleReady() {}; player.on('ready', handleReady); // Some events are triggered frequently. You can use player.one to listen only once. player.one('canplay', () => {});You can unsubscribe from events using the `off` method of the player instance. The following code provides an example:
player.off('ready',handleReady);