You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

<Work in progress>

Unified Video Engine (UVE) APIs

This document explains how users can evaluate/adopt AAMP for media player applications. 


Overview



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.


Target Audience

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. 

Features 

  • Formats: HLS, DASH, Fragmented MP4 HLS 
  • DRM Systems: Clear Key, Adobe Access, Vanilla AES-128, PlayReady, Widevine 
  • Captions: CEA-608/708 Captions , WebVTT 

Roadmap

  • Video Guard (VGC) DRM 
  • DVB, EBU-TT captions

Release Version

S.No.Release VersionRelease Notes 
10.7 Initial draft of UVE APIs implemented 
20.8 CDAI support, configuration options for tune optimization 
API: 
  • setAlternateContent 
  • notifyReservationCompletion 
  • addCustomHTTPHeader 


Configuration: 

  • stereoOnly 
  • bulkTimedMetadata 
  • useWesterosSink 
  • parallelPlaylistDownload 


Events: 

  • bufferingChanged 
  • timedMetadata 
  • adResolved 
  • reservationStart 
  • reservationEnd 
  • placementStart 
  • placementEnd 
  • placementProgress 
  • placementError
30.9 “Player Switching” Feature
  • load (autoplay=false support) 
  • detach() method
41.0

Added support to get available audio track and closed captioning info

API: 

  • getAvailableAudioTracks
  •  getAvailableTextTracks 


Configuration: 

  • playlistTimeout
  • parallelPlaylistRefresh
  • useAverageBandwidth
  • preCachePlaylistTime
  • progressReportingInterval
  • useRetuneForUnpairedDiscontinuity
  • drmDecryptFailThreshold 
52.4 

April 2020 Release Update 

Configuration:

  • initialBuffer
  • useMatchingBaseUrl
  • initFragmentRetryCount

Event Notification 

62.6 

June 2020 Release Update 
Seek while paused, get/set audio and text track supported 

API:

  • getAudioTrack
  • setAudioTrack
  • getTextTrack
  • setTextTrack
  • setClosedCaptionStatus
  • setTextStyleOptions
  • getTextStyleOptions 

Configuration:

  • nativeCCRendering
  • langCodePreferenc
  • descriptiveTrackName  
72.7 

Aug 2020 Release Update 

Configuration:

  • Deprecated useWesterosSink 
82.9 

Sept 2020 Release Update 

Configuration:

  • authToken
  • useRetuneForGstInternalError
93

Oct 2020 Release update. 

  • Updated getAvailableAudioTracks / getAvailableTextTracks 

API: 

  • setAudioLanguage 

Configuration: 

  • propagateUriParameters 
    reportVideoPTS

ATSC – UVE Features Added .  

103.1

Jan 2021 Release update. 
ATSC New APIs / Events

API: 

  • getAvailableThumbnailTracks
  • setThumbnailTrack
  • getThumbnail 

Configuration: 

  • sslVerifyPeer
  • persistBitrateOverSeek
  • setLicenseCaching
  • maxPlaylistCacheSize
  • enableSeekableRange  
113.2

Mar 2021 Release update 
API: 

  • setPreferredAudioLanguage
  • setAudioTrack 

Configuration:  

  • livePauseBehavior
  • limitResolution 
123.3

May 2021 Release update 
Configuration:

  • useAbsoluteTimeline asyncTune 

Events : 

  • Updated bitrateChanged for ATSC 
133.4

Events :  

  • audioTracksChanged
  • textTracksChanged
  • seeked
  • vttCueDataListener
  • id3Metadata
143.5

Aug 2021 Release update 
API:

  • load (updated)
  • setPreferredAudioLanguage (updated)
  • getAvailableAudioTracks (updated)
  • getAvailableTextTracks (updated)
  • downloadBuffer default value(updated) 

Events :

 id3Metadata

153.6 

Sept 2021 Release update 

Configuration:

  • disable4K
  • sharedSSL
  • preferredAudioRendition
  • preferredAudioCodec  

Events: 

  • mediaMetadata (updated) 

Minimal Sample Player

<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>

General Setup

To setup the AAMP Reference Player in RDK devices(Comcast):

  1. Host the ReferencePlayer folder in a web server.
  2. Use Comcast's IBIS tool (https://ibis.comcast.com/app-dev-tool/send-html-app) to launch the reference player in the 
    device: 

                   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.

Folder Structure: Full Reference Player

-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

Universal Video Engine APIs  

PROPERTIES:

NameType Description
version numberMay be used to confirm if RDKV 
build in use supports a newer 
feature 
AAMP.version numberGlobal variable for applications to 
get UVE API version without 
creating a player instance. Value 
will be same as player.version. 

METHODS:  

load( uri, autoplay, tuneParams) 

  • Begin streaming
NameType Description
UriString URI of the Media to be played by the Video Engine
autoplayBooleanoptional 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. 
tuneParamsObjectoptional 3rd parameter 
The tuneParams Object includes four elements contentType, traceId, 
isInitialAttempt and isFinalAttempt. Details provided in below table 
NameTypeDescription
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  
traceIdStringTrace ID which is unique for a tune. 
isInitialAttempt BooleanFlag 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.
keepPauseBooleanFlag indicates if player was in paused state before seek then maintain the 
same state post seek 
Available starting with version 2.6 

getCurrentPosition()

  • Supported UVE version 0.7 and above.

  • Returns current playback position in seconds.

getCurrentState() 

  • Supported UVE version 0.7 and above.
  • Returns one of below logical player states as number: 
State NameValue SemanticsRemarks 
idle0eSTATE_IDLE Player is idle
initializing1eSTATE_INITIALIZINGPlayer is initializaing resources to 
start playback 

2eSTATE_INITIALIZEDPlayer is initializaing resources to 
start playback 

3eSTATE_PREPARINGCreate internal resources required 
for DRM decryption and playback 

4eSTATE_PREPARED Required resources are initialized 
successfully

5eSTATE_BUFFERINGWhen player does internal buffering 
mid-playback. Note -send out in 
initial buffering

6eSTATE_PAUSEDIndicates player is paused 

7eSTATE_SEEKINGIndicates player is seeking

8eSTATE_PLAYINGIndicates player is seeking

9eSTATE_STOPPINGNot supported, for future 

10eSTATE_STOPPEDNot supported, for future 

11eSTATE_COMPLETE When the media reaches end. 

12eSTATE_ERRORIn case any error occurred

13eSTATE_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() 


  • No labels