load( uri, autoplay, tuneParams) Name | Type | Description |
---|
Uri | String | URI of the Media to be played by the Video Engine | autoplay | Boolean | optional 2nd parameter (defaults to true) If false, causes stream to be prerolled/prebuffered only, but not immediately automatically presented. Available starting with version 0.8. | tuneParams | Object | optional 3rd parameter The tuneParams Object includes four elements contentType, traceId, isInitialAttempt and isFinalAttempt. Details provided in below table |
Name | Type | Description |
---|
contentType | String | Content Type of the asset taken for playback. Eg: CDVR, VOD, LINEAR_TV, IVOD, EAS, PPV, OTT, OTA, HDMI_IN, COMPOSITE_IN, SLE | traceId | String | Trace ID which is unique for a tune. | isInitialAttempt | Boolean | Flag indicates if it’s the first tune initiated, tune is neither a retry nor a rollback. | isInitialAttempt | Boolean | Flag indicates if it’s the first tune initiated, tune is neither a retry nor a rollback. |
play() - Supported UVE version 0.7 and above.
- Start playback (if stream is in prebuffered state), or resume playback at normal speed. Equivalent to
setPlaybackRate(1).
pause()- Supported UVE version 0.7 and above.
- Pauses playback. Equivalent to setPlaybackRate(0).
stop()- Supported UVE version 0.7 and above.
- Stop playback and free resources associated with playback.
seek( offset )- Supported UVE version 0.7 and above.
- Specify initial or new stream playback position. May be called prior to first load() call (or implicitly using
initConfig’s “offset” parameter), or while streaming.
Name | Type | Description |
---|
offset | Number (s) | Offset from beginning of VOD asset. For live playback, offset is relative to eldest portion of initial window. Offset value should be in seconds Note that ability to seek is currently limited to fragment granularity. | keepPause | Boolean | Flag indicates if player was in paused state before seek then maintain the same state post seek Available starting with version 2.6 |
getCurrentPosition()getCurrentState() - Supported UVE version 0.7 and above.
- Returns one of below logical player states as number:
State Name | Value | Semantics | Remarks |
---|
idle | 0 | eSTATE_IDLE | Player is idle | initializing | 1 | eSTATE_INITIALIZING | Player is initializaing resources to start playback |
| 2 | eSTATE_INITIALIZED | Player is initializaing resources to start playback |
| 3 | eSTATE_PREPARING | Create internal resources required for DRM decryption and playback |
| 4 | eSTATE_PREPARED | Required resources are initialized successfully |
| 5 | eSTATE_BUFFERING | When player does internal buffering mid-playback. Note -send out in initial buffering |
| 6 | eSTATE_PAUSED | Indicates player is paused |
| 7 | eSTATE_SEEKING | Indicates player is seeking |
| 8 | eSTATE_PLAYING | Indicates player is seeking |
| 9 | eSTATE_STOPPING | Not supported, for future |
| 10 | eSTATE_STOPPED | Not supported, for future |
| 11 | eSTATE_COMPLETE | When the media reaches end. |
| 12 | eSTATE_ERROR | In case any error occurred |
| 13 | eSTATE_RELEASED | Not supported, for future |
getDurationSec()- Supported UVE version 0.7 and above.
- Returns current duration of content in seconds. Duration is fixed for VOD content, but may grow with DVR
content.
getVolume()- Supported UVE version 0.7 and above.
- Get current volume (value between 0 and 100). Default audio volume is 100. Volume is normally mapped from
remote directly to TV, with video engine used to manage an independent mute/unmute state for parental control.
setVolume ( volume )- Supported UVE version 0.7 and above.
- Sets the current volume (value between 0 and 100). Updated value reflected in subsequent calls to getVolume()
Name | Name | Description |
---|
volume | Number | Pass zero to mute audio. Pass 100 for normal (max) audio volume. |
setVideoMute( enabled )- Supported UVE version 0.7 and above.
- Enable or black out video for parental control purposes, default is false
Name | Type | Description |
---|
volume | Number | Pass false to black out video. Pass true to resume presenting video. |
getPlaybackRate()- Supported UVE version 0.7 and above.
- Returns the current playback rate.
setPlaybackRate( rate )- Supported UVE version 0.7 and above.
- Change playback rate, supported speeds are given below -
Value | Description |
---|
0 | Pause | 1 | Normal Play | 4 | 2x Fast Forward (using iframe track) | 16 | 4x Fast Forward (using iframe track) | 32 | 8x Fast Forward (using iframe track) | 64 | 16x Fast Forward (using iframe track) | -4 | 2x Rewind (using iframe track) | -16 | 4x Rewind (using iframe track) | -32 | 4x Rewind (using iframe track) | -64 | 16x Rewind (using iframe track) |
getVideoBitrates()- Supported UVE version 0.7 and above.
- Return array of available video bitrates across profiles.
getCurrentVideoBitrate()- Supported UVE version 0.7 and above.
- Return current video bitrate, as bits per second.
setVideoBitrate( bitrate )- Supported UVE version 0.7 and above.
Name | Type | Description |
---|
bitrate | Number | Pass bitrate from getVideoBitrates to disable ABR and lock playback to single profile. Pass zero to (re)enable ABR, allowing Video Engine to select from available bitrates based on network bandwidth. |
getCurrentAudioBitrate()- Supported UVE version 0.7 and above.
- Return current audio bitrate, as bits per second.
setVideoRect( x, y, w, h )- Supported UVE version 0.7 and above.
- Set display video rectangle coordinates. Note that by default video will be fullscreen.
- Rectangle specified in “graphics resolution” coordinates (coordinate space used by graphics overlay).
- Window size is typically 1280x720, but can be queried at runtime as follows:
var w = window.innerWidth || document.documentElement.clientWidth ||document.body.clientWidth; var h = window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight;
Name | Type | Description |
---|
X | Number | Left position for video | Y | Number | Top position for video | W | Number | Video width | H | Number | Video height |
setVideoZoom( videoZoom )- Supported UVE version 0.7 and above.
- Set video zoom, by default its set to “full”
Name | Type | Description |
---|
videoZoom | String | “none” to disable video zoom mode. “full” to enable video zoom mode. |
- Supported UVE version 0.8 and above.
- Add custom headers to HTTP requests
Name | Type | Description |
---|
headerName | String | HTTP header name | headerValue isLicenseRequest | String Array Boolean | HTTP header value (defaults to false) indicates if the HTTP header is for exclusive use with PlayReady/Widevine license requests |
- Supported UVE version 0.8 and above.
- Remove a custom header set previously. If called with no arguments, will remove all custom headers.
Name | Type | Description |
---|
headerName | String | HTTP header name |
getAvailableAudioTracks()- Supported UVE version 1.0 and above.
- Returns the available audio tracks information in the content.
DASH Name | Type | Description |
---|
name | String | Human readable language name e.g: Spanish, English | language | String | Specifies dominant language of the audio e.g: spa, eng | rendition | String | Role for DASH If not present, the role is assumed to be main e.g: caption, subtitle, main | characteristics | String | Not mapped | Channels | String | Indicates the maximum number of audio channels 1 = mono, 2=stereo, up to 8 for DD+ | bandwidth | String | Represents variants of the bitrates available for the media type e.g: 288000 | codec | String | codec associated with Adaptation Set. e.g: mp4a.40.2 | accessibilityType | String | Accessibility value for descriptive, visually impaired signaling e.g: description, captions |
Code Block |
---|
language | xml |
---|
theme | Midnight |
---|
title | Example |
---|
| {
"name": "5",
"language": "ger",
"codec": "mp4a.40.2",
"rendition": "german",
"accessibiltyType": "description",
"bandwidth": 288000
}
|
Code Block |
---|
theme | Midnight |
---|
title | Reference |
---|
| <AdaptationSet id="3" contentType="audio" segmentAlignment="true" bitstreamSwitching="true" lang="ger">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="german"/>
<Accessibility schemeIdUri="urn:mpeg:dash:role:2011" value="description" />
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="288000" audioSamplingRate="48000"
>
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
</AdaptationSet> |
HLS Name | Type | Description |
---|
name | String | Human-readable description of the Rendition. e.g:english, spanish | type | String | Specifies the media type. Valid strings are AUDIO, VIDEO, SUBTITLES and CLOSED-CAPTIONS. This attribute is REQUIRED. e.g: CLOSED-CAPTIONS | language | String | Identifies the primary language used in the Rendition. This attribute is OPTIONAL. e.g: es | rendition | String | Specifies the group to which the Rendition belongs. GROUP-ID for HLS. | instreamId | String | Specifies a Rendition within the segments in the Media Playlist. This attribute is REQUIRED if the TYPE attribute is CLOSED-CAPTIONS e.g: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n MUST be an integer between 1 and 63 | codec | String | Comma-delimited list of formats, where each format specifies a media sample type that is present in one or more Renditions specified by the Variant Stream. | characteristics | String | Pne or more comma-delimited Uniform Type Identifiers [UTI]. This attribute is OPTIONAL. |
Code Block |
---|
language | xml |
---|
theme | Midnight |
---|
title | Example |
---|
| {
"name": "Deutsch",
"type": "SUBTITLES",
"language": "de",
"rendition": "subs"
}
Reference
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUPID="subs",NAME="Deutsch",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,LANGUAGE="de",URI="subtitles_de.m3u8"
#EXT-X-STREAM-INF:PROGRAMID=1,BANDWIDTH=258157,CODECS="avc1.4d400d,mp4a.40.2",AUDIO="stereo",RESOLUTION=422x180,SUBTITLES="subs" |
getVideoRectangle()- Supported UVE version 1.0 and above.
- Returns the current video rectangle co-ordinates.
getAudioTrack( )- Supported UVE version 2.6 and above.
- Returns the index of current audio track in available audio track list.
setAudioTrack(index ) - Supported UVE version 2.6 and above.
- Set the audio track language from available audio track list.
Name | Type | Description |
---|
index | Number | Track Index of desired audio track in available audio track list |
setAudioTrack( trackDescriptorObj )- Supported UVE version 3.2 and above.
- Set the audio track by language and rendition from available audio track list.
- “language” match always takes precedence over “rendition” match.
- While playing passively to new periods with different track order/availability, or when tuning to new locator,
heuristic for track selection is automatically re-applied. - Note that for now, “best” codec (ATMOS > DD+ > Stereo) is always selected, subject to filtering configuration.
Name | Type | Description |
---|
language | String | Language of desired audio track in available audio track list | rendition | String | Rendition of desired audio track in available audio track list |
Code Block |
---|
language | xml |
---|
theme | Midnight |
---|
title | Example |
---|
| var trackDescriptorObject =
{
"language": "ger",
"rendition": "commentary"
}
playerInstance.setAudioTrack( trackDescriptorObject ); |
setPreferredAudioLanguage( languages, rendition, accessibility)- Supported UVE version 3.2 and above.
- Set the audio track preference by languages, rendition and accessibility.
- This is functionally equivalent to passing a trackDescriptorObject to setAudioTrack above.
- May be called pre-tune or post tune.
Name | Type | Description |
---|
languages | String | ISO-639 audio language preference; for more than one language, provide comma delimited list from highest to lowest priority: ‘,<...>,’ | rendition | String | Optional preferred rendition for automatic audio selection. | accessibility | String | Optional preferred accessibility type for descriptive audio. |
setAudioLanguage ( language )- Supported UVE version 3.0 and above.
- Set the audio track language from available audio track list.
Name | Type | Type |
---|
language | String | Language of desired audio track in the available audio track list. |
getTextTrack( ) - Supported UVE version 2.6 and above.
- Returns the index of current text track in available text track list.
setTextTrack( trackIndex )- Supported UVE version 2.6 and above.
- Set the text track at trackIndex in available text track list.
Name | Type | Description |
---|
trackIndex | Number | Index of desired text track in available text track list |
setClosedCaptionStatus ( status )- Supported UVE version 2.6 and above.
- Set the ClosedCaption rendering to on/off.
Name | Type | Description |
---|
Status | Boolean | To turn on/off ClosedCaption rendering. |
getTextStyleOptions ( )- Supported UVE version 2.6 and above.
- Returns the JSON formatted string of current ClosedCaption style options and values.
setTextStyleOptions ( options ) - Supported UVE version 2.6 and above.
- Set the ClosedCaption style options to be used for rendering.
Name | Type | Description |
---|
options | String | JSON formatted string of different rendering style options and its values. |
getAvailableThumbnailTracks ( )- Returns json array of each thumbnail track's metadata.
Name | Type | Description |
---|
Resolution | String | String indicating the width x height of the thumbnail images. | Bandwidth | String | Decimal-Integer encoding - bits per second. Represents bit rate of the thumbnail track. |
Code Block |
---|
language | xml |
---|
theme | Midnight |
---|
title | Example |
---|
| [{
"RESOLUTION": "416x234",
"BANDWIDTH": 71416
}, {
"RESOLUTION": "336x189",
"BANDWIDTH": 52375
}, {
"RESOLUTION": "224x126",
"BANDWIDTH": 27413
}]
|
setThumbnailTrack(index)- Set the desired thumbnail track from the list of available thumbnail track metadata.
- Returns Boolean value true or false to indicate Success or Failure configuring the thumbnail track.
Name | Type | Description |
---|
Index | Number | Index value based on the available thumbnail tracks. |
getThumbnail(startPosition, endPosition) - Get the thumbnail data for the time range “startPosition” till “endPosition”.
Name | Type | Description |
---|
startPosition | Number | Start value from which the thumbnail data is fetched. | endPosition | Number | End value till which the thumbnail data is fetched. | baseUrl | String | The base url which is appended to tile url to fetch the required thumbnail image. | raw_w | String | Original width of the thumbnail sprite sheet. | raw_h | String | Original height of the thumbnail sprite sheet. | width | String | Width of each thumbnail tile present in the sprite sheet. | height | String | Height of each thumbnail tile present in the sprite sheet. | tile | String | JSON array of multiple thumbnail tile information. | url | String | Url for each tile, which is appended with base url to form complete url. | t | String | Presentation time for each tile. | d | String | Duration value of each tile. | x | String | X co-ordinate position to locate the tile from sprite sheet. | y | String | Y co-ordinate position to locate the tile from sprite sheet. |
Code Block |
---|
language | xml |
---|
theme | Midnight |
---|
title | Example |
---|
| {
"baseUrl": "https://g004-c-13a10cpeacockvodstg.s.llnwi.net/pub/global/aOb/kIc/PCK_1604349987778_01/cmaf_thumbtest_segtime_d/mpeg_2sec/
images/416x234/",
"raw_w": 3744,
"raw_h": 3978,
"width": 416,
"height": 234,
"tile": [{
"url": "pckimage-1.jpg",
"t": 328.0,
“d”: 2,
"x": 832,
"y": 234
}]
}
|
|