Namespace: player

ENABLE. player

All the players created in the same session will be released automatically at the end of session (beforeunload event). However, you could release manually release the player to release the resources

Members

static,constantENABLE.player.NO_ENCRYPTIONString

Parameter for ENABLE.player#setSource indicating how the video source is encrypted (only for DASH).

Since:
  • 1.0.0

static,constantENABLE.player.PLAYEREVENT_RELEASINGString

Event occurs before player released (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.PLAYER_EVENT_RELEASINGString

Event occurs before player released (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.PLAYREADYString

Parameter for ENABLE.player#setSource indicating how the video source is encrypted (only for DASH).

Since:
  • 1.0.0

static,constantENABLE.player.VIDEOEVENT_BUFFERINGString

Event occurs when media buffer is empty (e.g. DASH and HLS source) (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_DECRYPTION_FAILString

Event occurs when decryption fail (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_END_OF_STREAMString

Event occurs when video stream reaches the end (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_ERRORString

Event occurs when there is an unexpected error (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_METADATA_LOADEDString

Event occurs when metadata is loaded (e.g. tracks info, duration) (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_PLAYBACK_BUFFERINGString

Event occurs when media buffer is starting to buffer (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_PLAYBACK_BUFFER_READYString

Event occurs when media buffer is ready (e.g. DASH and HLS source) (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_PLAYBACK_RESUMEDString

Event occurs when video playback is resumed (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_PLAYBACK_STOPPEDString

Event occurs when video playback is stopped (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_READY_TO_STARTString

Event occurs when player is ready to start playback (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_SEEKEDString

Event occurs when video has seeked (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEOEVENT_STREAM_STARTEDString

Event occurs when video stream is started (see ENABLE.player#setEventCallback).

Since:
  • 1.0.0
Deprecated

static,constantENABLE.player.VIDEO_EVENT_BUFFERINGString

Event occurs when media buffer is empty (e.g. DASH and HLS source) (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_DECRYPTION_FAILString

Event occurs when decryption fail (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_END_OF_STREAMString

Event occurs when video stream reaches the end (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_ERRORString

Event occurs when there is an unexpected error (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_METADATA_LOADEDString

Event occurs when metadata is loaded (e.g. tracks info, duration) (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_PLAYBACK_BUFFERINGString

Event occurs when media buffer is starting to buffer (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_PLAYBACK_BUFFER_READYString

Event occurs when media buffer is ready (e.g. DASH and HLS source) (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_PLAYBACK_RESUMEDString

Event occurs when video playback is resumed (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_PLAYBACK_STOPPEDString

Event occurs when video playback is stopped (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_READY_TO_STARTString

Event occurs when player is ready to start playback (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_SEEKEDString

Event occurs when video has seeked (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.VIDEO_EVENT_STREAM_STARTEDString

Event occurs when video stream is started (see ENABLE.player#setEventCallback).

Since:
  • 1.7.0

static,constantENABLE.player.WIDEVINEString

Parameter for ENABLE.player#setSource indicating how the video source is encrypted (only for DASH).

Since:
  • 1.0.0

Methods

getAudioRendering(){Object}

player.js, line 959

Get the audio rendering status.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
result boolean true, audio rendering is enabled, false, audio rendering is disabled

getAudioStats(){Object}

player.js, line 850

Get Audio Decoder statistics

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
input_buffer_count Number The number of queued input buffers.
rendered_output_buffer_count Number The number of rendered output buffers.
dropped_buffer_count Number The number of dropped buffers. A dropped buffer is a buffer that was supposed to be decoded/rendered, but was instead dropped because it could not be rendered in time.
elapsed_ms Number Total elapsed time in milliseconds since playback started.
bitrate Number The estimated bitrate, in bits per second.
bytes_transferred Number The total transferred data in bytes since playback started.

getAudioTrack(){Object}

player.js, line 671

Retrieves comprehensive information about all audio tracks available in the current stream, including the identifier of the currently selected track.

Since:
  • 1.7.0
Returns:
Name Type Description
object Object
Name Type Description
selected Number The currently selected audio track. This id corresponds to the id property in each track object within the tracks array.
A value of -1 indicates that no audio track is currently selected.
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
tracks Array.<Object> An array of object track information.
Name Type Description
id Number identify of the track for selecting
lang String a language code in either way of ISO-639-1 or ISO-639-2.
When the language is unknown or could not be determined, language code "und" is returned.
stream_type String The name of the codec of the stream, derived from the codec or MIME type.
mime_type String MIME type of the format. Common audio MIME types include:
- audio/wav for WAV
- audio/ogg for OGG Vorbis
- audio/aac for AAC
codec String Codecs of the format as described in RFC 6381.
When the codec is unknown or could not be determined, null will be returned.
sample_rate Number The audio sampling rate in Hz, or -1 if unknown or not applicable.
bitrate Number The bitrate in bits per second. -1 if unknown or not applicable.
num_of_channels Number Number of audio channels
streamType String deprecated, use stream_type instead
mimeType String deprecated, use mime_type instead

getBlank(){Object}

player.js, line 392

Retrieves the current blank status of the video screen.

Since:
  • 1.0.0
See:
  • ENABLE.ENABLE.player#setBlank
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result Boolean true or false

getBufferedDuration(){Object}

player.js, line 587

Gets the duration of the buffered content. Useful for live streams like multicast and HLS.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result Number The duration of the buffered content in milliseconds.

getDuration(){Object}

player.js, line 573

Retrieves the duration of the current playback in milliseconds.

Behavior for Different Content Types:

  • VOD (Video on Demand): Returns the total duration of the current media.
  • Live Content:
    • ABR Streams (like HLS, DASH): Returns the length of the moving window, which is the amount of content available for immediate playback.
    • Multicast and SRT Streams: Returns the sum of current buffered duration and the elapsed time since the stream became ready to start.

Note: This function will return NOT_READY when no active video source.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result Number The duration in milliseconds.
If no duration is available (for example, if streaming live content), -1 is returned.

getMute(){Object}

player.js, line 422

Get the current mute status.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result Boolean true or false

getOsdResolution(){Object}

player.js, line 505

Retrieves the total size of the screen usable for positioning the video window.

This function provides the dimensions of the On-Screen Display (OSD) area, which represents the full extent of the screen where video can be displayed or positioned.
Use these dimensions when calling ENABLE.player#setVideoRect to place and size the video appropriately within the screen.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
width Number Width of screen in pixels.
height Number Height of screen in pixels.

getPlayPosition(){Object}

player.js, line 610

Retrieves the current playback position in milliseconds.

Behavior for Different Content Types:

  • VOD (Video on Demand): Returns the current playback position within the media.

  • Live Content:

    • ABR Streams (like HLS, DASH): Returns the position within the live moving window. This represents how far into the currently available content the playback is.
    • Multicast and SRT Streams: Returns the elapsed time since the video started playing. This value stops increasing when the video is paused.
  • Note: This function will return NOT_READY when no active video source is set.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result Number The current position in milliseconds

getPlayerId(){Object}

player.js, line 135

Get player ID of current player instance

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
id Number The id of the player

getSource(){Object}

player.js, line 256

Retrieves the current media URI configured for the player along with its associated configuration.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
source String current source.
config Object Configuration. Please refer to ENABLE.player#setSource

getSpeed(){Object}

player.js, line 299

Get the current playback speed.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result Number current speed, where:
- 1 indicates normal speed
- Other values represent speed multipliers (e.g., 2 for double speed, 0.5 for half speed)

getTextTrack(){Object}

player.js, line 633

Gets the information about text track.

Since:
  • 1.7.0
Returns:
Name Type Description
object Object
Name Type Description
selected Number The currently selected text track. This id corresponds to the id property in each track object within the tracks array.
A value of -1 indicates that no text track is currently selected.
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
tracks Array.<Object> An array of object track information.
Name Type Description
id Number identify of the track for selecting
type String type of text track, e.g. subtitle, teletext and timedText
mime_type String MIME type of the format.
lang String a language code in either way of ISO-639-1 or ISO-639-2.
When the language is unknown or could not be determined, language code "und" is returned.
mimeType String deprecated, use mime_type instead

getVideoRect(){Object}

player.js, line 469

Get current on screen position of the video window.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
x Number The visual x position of video window, in pixels.
y Number The visual y position of video window, in pixels.
width Number The width of video window, in pixels.
height Number The height of video window, in pixels.

getVideoRotation(){Object}

player.js, line 890

Get video rotation parameters. Video may be rotated by 0, 90, 180 or 270 degrees

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
angle Number Angle of rotation
x Number X coordinate of the video after rotation
y Number Y coordinate of the video after rotation
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY

getVideoStats(){Object}

player.js, line 831

Get Video Decoder statistics

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
input_buffer_count Number The number of queued input buffers.
rendered_output_buffer_count Number The number of rendered output buffers.
dropped_buffer_count Number The number of dropped buffers. A dropped buffer is a buffer that was supposed to be decoded/rendered, but was instead dropped because it could not be rendered in time.
elapsed_ms Number Total elapsed time in milliseconds since playback started.
bitrate Number The estimated bitrate, in bits per second.
bytes_transferred Number The total transferred data in bytes since playback started.

getVideoTrack(){Object}

player.js, line 711

Retrieves comprehensive information about all video tracks available in the current stream, including the identifier of the currently selected track.

Since:
  • 1.7.0
Returns:
Name Type Description
object Object
Name Type Description
selected Number The currently selected video track. This id corresponds to the id property in each track object within the tracks array.
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
tracks Array.<Object> An array of object track information.
Name Type Description
id Number identify of the track
width Number The width of the video in pixels, or -1 if unknown or not applicable.
height Number The height of the video in pixels, or -1 if unknown or not applicable.
stream_type String The name of the codec of the stream, derived from the codec or MIME type.
mime_type String MIME type of the format. Common video MIME types include:
- video/mp4 for MP4 files
- video/webm for WebM files
- video/ogg for Ogg Theora
- video/mpeg for MPEG video
codec String Codecs of the format as described in RFC 6381.
When the codec is unknown or could not be determined, null will be returned.
frame_rate Number The frame rate in frames per second.
The frame rate in frames per second, or -1 if unknown or not applicable.
bitrate Number The bitrate in bits per second. -1 if unknown or not applicable.
streamType String deprecated, use stream_type instead
mimeType String deprecated, use mime_type instead

getVolume(){Object}

player.js, line 796

Get Player Volume.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
left Number Left volume scalar (0 to 1.0)
right Number Right volume scalar (0 to 1.0)

getZOrder(){Object}

player.js, line 924

Get the Z Order of the players. The z-index of webview layer is 100. The z-order of the first player created will be 0.
The z-index of a newly created player will be the highest player z-index value plus one.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT for zIndex using negative number
result Number The z-index value

isLiveStream(){Object}

player.js, line 812

Returns true if current source is live.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result boolean if current source is live

play(speed){Object}

player.js, line 278

Plays the current video source at the specified speed multiplier.

Speed Values:

  • 0: Pauses the video playback.
  • 1: Plays the video at normal speed.
  • > 1: Speeds up playback (e.g., 2 for double speed).
  • 0 < speed < 1: Slows down playback (e.g., 0.5 for half speed).
  • < 0: Rewinds the video (e.g., -1 for normal rewind speed).
Name Type Description
speed Number

The desired speed to be played.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY or
ENABLE.status.INVALID_ARGUMENT

release(){Object}

player.js, line 352

Releases all resources associated with this player object after which the player will not longer be useable.
A ENABLE.player.PLAYEREVENT_RELEASING event will be emitted.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

reset(){Object}

player.js, line 340

Resets the player to its uninitialized state.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

seekTo(offset){Object}

player.js, line 314

Seeks to specified time position.

Name Type Description
offset Number

The offset in milliseconds from the start to seek to.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY or
ENABLE.status.INVALID_ARGUMENT

setAudioRendering(enable){Object}

player.js, line 943

Set the audio rendering of the players. This API is differs from ENABLE.player#setMute and ENABLE.player#setVolume.

  • Mutual Exclusivity: Only one player may play audio at any time. When rendering is enabled on a player instance, audio rendering for all other player instances is automatically disabled.
  • CPU Efficiency: Disabling audio rendering conserves CPU resources by stopping the audio track when not required.
  • Control:
    • Setting this to false disables audio rendering for all player instances, effectively silencing all player audio.
    • When creating additional player instances (the second or more), audio rendering is disabled by default to maintain this exclusivity.
Name Type Description
enable boolean

true for enables audio rendering for the current player, false for disables audio rendering for all players.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

setAudioTrack(id){Object}

player.js, line 761

Select an audio track based on track id. Track id may be retrieved by calling ENABLE.ENABLE.player#getAudioTrack().

Name Type Description
id Number

Track id of audio

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setBlank(isBlank){Object}

player.js, line 375

Toggles the visibility of the video screen by setting it to blank or restoring it to its original state.
This method is particularly useful for transitions, e.g. creating a visual break or pause in video playback for user experience or presentation effects.

Name Type Description
isBlank Boolean

Pass true to blank or false to unblank

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setEventCallback(callback){Object}

player.js, line 546

Register player callback function for JavaScript application.
Only one callback function can be registered. Pass null to unregister.
Example:

var callback = function(obj) {
    if (obj.event === ENABLE.video.VIDEO_EVENT_STREAM_STARTED){
        console.log("playback started!");
    }
};
video.setEventCallback(callback);
Name Type Description
callback PlayerEventCallback

Callback function will be invoked when events are received.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setMute(is_mute){Object}

player.js, line 406

Mute the player of current application.

Name Type Description
is_mute Boolean

Pass true to mute or false to unmute

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setResizeMode(mode){Object}

player.js, line 485

Set the resize mode of video

Name Type Description
mode Number

The resize mode of video,
ENABLE.preference.RESIZE_MODE_FIT,
ENABLE.preference.RESIZE_MODE_FILL, or
ENABLE.preference.RESIZE_MODE_ZOOM

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code Object ENABLE.status.SUCCESS or ENABLE.status.INVALID_ARGUMENT

setSource(url, config){Object}

player.js, line 229

Set video source of player

ABR (DASH and HLS): https://{host}:{port}/{playlist_path}

Play a ABR stream

var videoControl = ENABLE.player.getInstance(0);
videoControl.setSource("http://www.aminocom.com/videos/playlist.mpd");
// or
videoControl.setSource("http://www.aminocom.com/videos/playlist.m3u8");

Play a widevine encrypted DASH stream

var config = {encryption_type: "com.widevine.alpha", encrypting_server: "http://demo.aminocom.com/license"};
videoControl.setSource("http://www.aminocom.com/videos/sample_enc.mpd", config);

Play a widevine encrypted DASH stream with persistent license

var config = {encryption_type: "com.widevine.alpha", encrypting_server: "http://demo.aminocom.com/license", drm_session_type: "persistent"};
videoControl.setSource("http://www.aminocom.com/videos/sample_enc.mpd", config);

Play a widevine encrypted DASH stream with custom headers when requesting encryption license

var config = {
  encryption_type: "com.widevine.alpha",
  encrypting_server: "http://demo.aminocom.com/license",
  encrypting_request_header: {"header_a": ".....", "header_b": "...."}
}
videoControl.setSource("http://www.aminocom.com/videos/sample_enc.mpd", config);
HTTP Progressive: https://{host}:{port}/{file_path}
videoControl.setSource("http://192.168.1.1/abc.mp4");
Unicast: udp://{address}:{port}?prog_id=[number]&disable_av_sync=[boolean]
videoControl.setSource("udp://0.0.0.0:8110");
Multicast: udp://{address}:{port}?prog_id=[number]&disable_av_sync=[boolean]

Play a multicast video

videoControl.setSource("udp://233.22.133.100:8110");

Play a multicast video with program id specified and AV sync disabled

videoControl.setSource("udp://233.22.133.100:8110?prog_id=1&disable_av_sync=true");
RTSP: rtsp://{server}/{asset}
videoControl.setSource("rtsp://www.domain.com:554/stream.ts");
RTMP: rtmp://{server}/{path}
videoControl.setSource("rtmp://www.domain.com/stream/path");
SRT: srt://{address}:{port}?streamid=[number]&password=[string]
videoControl.setSource("srt://1.2.3.4:8888");
videoControl.setSource("srt://1.2.3.4:8888?streamid=3&password=aaaa");
IGMPv3: igmpv3://{address}:{port}?mcast=[asm|ssm_include|ssm_exclude]&src_addr=[address]
videoControl.setSource("igmpv3://192.168.1.1:8110?mcast=asm");
videoControl.setSource("igmpv3://192.168.1.1:8110?mcast=ssm_include&src_addr=192.168.1.30&src_addr=192.168.1.32");
videoControl.setSource("igmpv3://192.168.1.1:8110?mcast=ssm_exclude&src_addr=192.168.1.30&src_addr=192.168.1.32");
Name Type Description
url String

URL of video source.

config Object optional

Configuration.

Name Type Description
blank_when_open boolean optional

Default: true. Blank video during channel zapping and unblank when first frame rendered.

mute_when_open boolean optional

Default: true. Mute audio during channel zapping and unmute when first frame rendered.

encryption_type String optional

Encryption type, one of ENABLE.player.NO_ENCRYPTION, ENABLE.player.WIDEVINE or ENABLE.player.PLAYREADY.

encrypting_server String optional

Encrypting server URL.

encrypting_request_header Object optional

Additional headers for requesting the encryption license.

drm_session_type String optional

Set persistent for the type of drm session to make the license and key(s) persisted (Widevine server have to enable it).

loop_on_end boolean optional

Default: false. Set true to replay the video upon video end.

Since:
  • 1.1.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

setTextTrack(id){Object}

player.js, line 733

Select a text track

Name Type Description
id Number

Track id of text track

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setVideoRect(x, y, width, height){Object}

player.js, line 439

Set on screen position for the video window. This API is for displaying video at specific screen position with size smaller than full screen.
Pass -1 for width and height to reset video to full screen

Name Type Description
x Number

Sets the visual x position of video window, in pixels.

y Number

Sets the visual y position of video window, in pixels.

width Number

The width of video window, in pixels.

height Number

The height of video window, in pixels.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or ENABLE.status.INVALID_ARGUMENT

setVideoRotation(angle, x, y){Object}

player.js, line 869

Set video rotation
Supported degrees of 0, 90, 180 and 270 only
Input x and y will override x,y of setVideoRect() when degree is 90 and 270
Video Rotation only supports when the number of video player instances is not more than 2. The rotation behaviour is undefined when there are more than 2 video player instances. The undefined behaviour could only be removed with device reboot with new APK installation.

Name Type Description
angle Number

Angle of rotation

x Number optional

X coordinate of the video after rotation

y Number optional

Y coordinate of the video after rotation

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setVolume(left, right){Object}

player.js, line 778

Set Player Volume. This API controls volume of browser application. Use ENABLE.system.setVolume for system volume control.

Name Type Description
left Number

Left volume scalar (0 to 1.0)

right Number

Right volume scalar (0 to 1.0)

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

setZOrder(zIndex){Object}

player.js, line 905

Set the Z Order of the players. The z-index of webview layer is 100. The z-order of the first player created will be 0.
The z-index of a newly created player will be the highest player z-index value plus one.

Name Type Description
zIndex Number

The z-index of the player. The number should be non-negative number.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT for zIndex using negative number

stop(){Object}

player.js, line 329

Stops playback after playback has been started or paused.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY

unsetTextTrack(){Object}

player.js, line 748

Deselect text track.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY

staticENABLE.player.getCapability(){Object}

player.js, line 95

Get Player Capability.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
max_decoder Number Maximum number of hardware decoder. Switch to software decode if exceed the limit.

staticENABLE.player.getInstance(id){Object}

player.js, line 107

Get Player with player ID. A new Player will be created if a Player with the requested ID is not found.

Name Type Description
id Number

The player ID of the player

Since:
  • 1.0.0
Returns:
Type Description
Object A instance of player with the specified player ID

staticENABLE.player.releaseAll(){Object}

player.js, line 122

Release all player instances created in current session.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS