RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
<Work in progress>
This document explains how users can evaluate/adopt AAMP for media player applications.
AAMP is an open source native video engine that is built on top of GStreamer and optimized for performance, memory use, and
code size. AAMP Reference Player demonstrates how to use the Unified Video Engine (UVE) JavaScript binding APIs to
interact with an AAMP player.
The bindings are made available in JavaScript with the help of the injectedbundle component once the DOM elements are
loaded by WebKit.
This document is targeted to OTT app vendors and HTML5 developers who are interested in evaluating/adopting AAMP for
their media player applications on settops running RDKV based firmware.
S.No. | Release Version | Release Notes |
---|---|---|
1 | 0.7 | Initial draft of UVE APIs implemented |
2 | 0.8 | CDAI support, configuration options for tune optimization API:
Configuration:
Events:
|
3 | 0.9 | “Player Switching” Feature
|
4 | 1.0 | Added support to get available audio track and closed captioning info API:
|
5 | 2.4 | April 2020 Release Update Configuration:
Event Notification |
6 | 2.6 | June 2020 Release Update API:
Configuration:
|
7 | 2.7 | Aug 2020 Release Update Configuration:
|
8 | 2.9 | Sept 2020 Release Update Configuration:
|
9 | 3 | Oct 2020 Release update.
API:
Configuration:
ATSC – UVE Features Added . |
10 | 3.1 | Jan 2021 Release update. API:
Configuration:
|
11 | 3.2 | Mar 2021 Release update
Configuration:
|
12 | 3.3 | May 2021 Release update
Events :
|
13 | 3.4 | Events :
|
14 | 3.5 | Aug 2021 Release update
Events : id3Metadata |
15 | 3.6 | Sept 2021 Release update Configuration:
Events:
|
<html><head><title>IP Video Playback in WPE browser using UVE API</title></head> <script> window.onload = function() { var player = new AAMPMediaPlayer(); var url = "https://cpetestutility.stb.r53.xcal.tv/multilang/main.m3u8"; player.load(url); } </script> <body> <div id="videoContainer"> <video style="height:100%; width:100%; position:absolute; bottom:0; left:0"> <source src="dummy.mp4" type=”video/ave”> <!-- hole punching --> </video> </div> </body> </html>
To setup the AAMP Reference Player in RDK devices(Comcast):
a. Under Launch HTML App, select Select a device to get started.
b. From the list, find your device (it should be registered previously).
c. Enter the ReferencePlayer URL in the URL field.
d. Enter any name in the App name field.
e. Click Launch.
-icons // UI elements of reference players and homepage
-UVE
-index.html // Homepage of UVE reference player
-UVEMediaPlayer.js // Includes "AAMPPlayer" JS class which wraps UVE binding object AAMPMediaPlayer
-UVEPlayerUI.js // JS code for the UI elements and their functionality
-UVERefPlayer.js // Main JS file
-UVERefPlayerStyle.js // JS code for reference player and its UI
-index.html // Homepage of reference player
-ReferencePlayer.js // JS code for Homepage and redirection to respective reference players
-URLs.js // list of selectable streams
-ReferencePlayerStyle.css // CSS for Homepage and its UI
Name | Type | Description |
---|---|---|
version | number | May be used to confirm if RDKV build in use supports a newer feature |
AAMP.version | number | Global variable for applications to get UVE API version without creating a player instance. Value will be same as player.version. |
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. |
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 |
Supported UVE version 0.7 and above.
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 |
Name | Name | Description |
---|---|---|
volume | Number | Pass zero to mute audio. Pass 100 for normal (max) audio volume. |
Name | Type | Description |
---|---|---|
volume | Number | Pass false to black out video. Pass true to resume presenting video. |
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) |
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. |
Name | Type | Description |
---|---|---|
X | Number | Left position for video |
Y | Number | Top position for video |
W | Number | Video width |
H | Number | Video height |
Name | Type | Description |
---|---|---|
videoZoom | String | “none” to disable video zoom mode. “full” to enable video zoom mode. |
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 |
Name | Type | Description |
---|---|---|
headerName | String | HTTP header name |
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 |
{ "name": "5", "language": "ger", "codec": "mp4a.40.2", "rendition": "german", "accessibiltyType": "description", "bandwidth": 288000 }
<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. |
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"
Name | Type | Description |
---|---|---|
index | Number | Track Index of desired audio track in available audio track list |
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 |
Example var trackDescriptorObject = { "language": "ger", "rendition": "commentary" } playerInstance.setAudioTrack( trackDescriptorObject );
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. |
Name | Type | Type |
---|---|---|
language | String | Language of desired audio track in the available audio track list. |
Name | Type | Description |
---|---|---|
trackIndex | Number | Index of desired text track in available text track list |
Name | Type | Description |
---|---|---|
Status | Boolean | To turn on/off ClosedCaption rendering. |
Name | Type | Description |
---|---|---|
options | String | JSON formatted string of different rendering style options and its values. |
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. |
Example [{ "RESOLUTION": "416x234", "BANDWIDTH": 71416 }, { "RESOLUTION": "336x189", "BANDWIDTH": 52375 }, { "RESOLUTION": "224x126", "BANDWIDTH": 27413 }]
Name | Type | Description |
---|---|---|
Index | Number | Index value based on the available thumbnail tracks. |
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. |
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 }] }
Event Name | Event Payload | Description |
---|---|---|
playbackStarted | - Supported UVE version 0.7 and above. - fired when playback starts | |
playbackStateChanged | state: number | - Supported UVE version 0.7 and above. - fired as state changes across play/pause seek/not-seek quadruplet |
playbackProgressUpdate | durationMiliseconds: number, positionMiliseconds: number, playbackSpeed: number, startMiliseconds: number, endMiliseconds: number, currentPTS: number, videoBufferedMiliseco nds : number | - Supported UVE version 0.7 and above. - fired based on the interval set - Added video PTS reporting if enabled with reportVideoPTS config - Added video buffer value (2.4 version) |
bufferingChanged | buffering: bool | - Supported UVE version 0.8 and above. - fired when AAMP encounters buffering mid-playback, buffering flag indicates buffer status FALSE -> No buffer for playback(Underflow) TRUE -> Buffer available for playback |
playbackCompleted | - Supported UVE version 0.7 and above. - fired when there is nothing left to play | |
playbackSpeedChanged | speed: number, reason: string | - Supported UVE version 0.7 and above. |
playbackFailed | shouldRetry: boolean, code: number, description: string | - Supported UVE version 0.7 and above. - fired when an error occurs. |
decoderAvailable | decoderHandle: number | - Supported UVE version 0.7 and above. - fired when video decoder handle becomes available, required for closedcaption parsing + rendering by RDK ClosedCaptions module |
mediaMetadata | durationMiliseconds: playbackSpeeds: | - Supported UVE version 0.7 and above. - fired with metadata of the asset currently played, includes duration(in ms), audio language list, available bitrate list, hasDrm, supported playback speeds. |
speedsChanged | playbackSpeeds: number[] | - Supported UVE version 0.7 and above. - fired when supported playback speeds changes (based on iframe availability). |
id3Metadata | schemeIdUri : string value : string timescale : number presentationTime : number eventDuration : number id : number timestampOffset : number data : array length: number | - This event is fired when ID3Metadata is parsed from the stream playlist. |
vttCueDataListener | start : number duration: number | - This event is fired for VTT cue. parsed from the WebVTT playlist. |
audioTracksChanged | - fired when Audio track is changed during playback. | |
textTracksChanged | Position: number | - fired when Seek is triggered with a position. |
vttCueDataListener | code: number, description: string | - Supported UVE version 0.7 and above. - fired for VTT cue parsed from the WebVTT playlist in the asset. |
drmMetadata | code: number, description: string | - Supported UVE version 0.7 and above. - fired when there is a change in DRM metadata (especially expiration of DRM auth data). |
enteringLive | - Supported UVE version 0.7 and above. - fired when entering live point of a live playlist during/after a seek/trickplay operation. | |
timedMetadata | time: number, id: string | - Supported UVE version 0.8 and above. - fired when a subscribed tag is found in the playlist. |
bitrateChanged | time: number, bitRate: number, description: string, width: number, height: number, framerate: number position: number cappedProfile:bool displayWidth:number displayHeight:number | - Supported UVE version 0.7 and above. - fired when video profile is switched by ABR with the metadata associated with newly selected profile. |
adResolved | resolvedStatus: bool, placementId: string, placementStartTime: number, placementDuration: number | - Supported UVE version 0.8 and above. - Confirmation that an upcoming ad's main manifest has been successfully downloaded and parsed. |
reservationStart | adbreakId: string, time: number | - Supported UVE version 0.8 and above. - Sent upon playback into an ad break (one or more ads). |
reservationEnd | adbreakId: string, time: number | - Supported UVE version 0.8 and above. - Sent upon completion of an ad break (back to main content) - it is NOT sent (per previously agreed contract) if user does trickplay or seek to abort ad playback. |
placementStart | adId: string, time: number | - Supported UVE version 0.8 and above. - This is sent in real time when injecting first frame of a new ad on content->ad or ad->ad transition. Should be accurate compared to onscreen frames. |
placementEnd | adId: string, time: number | - Supported UVE version 0.8 and above. - This is sent in real time after passively playing to end of an ad - it is NOT sent (per previously agreed contract) if user does trickplay or seek to abort ad playback. |
placementProgress | adId: string, time: number | - Supported UVE version 0.8 and above. - Sent periodically while ad is being played out, giving an estimate percentagewatched metric. It's interpolated based on elapsed time, and should repeat same value if paused. |
placementError | adId: string, time: number, error: number | - Supported UVE version 0.8 and above. - Generated only for exception while attempting to play out ad content. |