initConfig( config )Configuration options are passed to AAMP using the UVE initConfig method. This allows the application override default configuration used by AAMP player to give more control over player behavior. Parameter is a JSON Object with one or more attribute/value pairs as follows: Property | Type | Default Value | Description |
---|
initialBitrate | Number | 2500000 | max initial bitrate (bps) | initialBitrate4K | Number | 13000000 | max initial bitrate for 4k video playback (bps) | Offset | Number (s) | 0 | start position offset in seconds(same as seek() method) | networkTimeout | Number (s) | 10 | network request timeout for fragment/playlist/manifest downloads (in seconds) | manifestTimeout | Number (s) | 10 | Manifest download timeout; overrides networkTimeout if both present; available starting with version 0.8 . Applied to Main manifest in HLS and DASH manifest download. (in seconds) | playlistTimeout | playlistTimeout | 10 | HLS playlist download timeout; overrides networkTimeout if both present; available starting with version 1.0 (in seconds) | downloadBuffer | Number | 4 | max amount of time to download ahead of playhead (fragments) example: - with a downloadBuffer of 4 (default) there will be 4 fragments (typically 2s each) of video or audio harvested and buffered in advance, in additional to internal playback buffering | minBitrate | Number | - | Optional profile clamping (in bps) | maxBitrate | Number | - | Optional profile clamping (in bps) | preferredAudioLanguage | String | en | ISO-639 audio language preference; for more than one language, provide comma delimited list from highest to lowest priority: ‘<HIGHEST>,<...>,<LOWEST>’ | timeShiftBufferLength | Number | - | (not supported, for future) | stereoOnly | Boolean | False | Optional forcing of playback to only select stereo audio track available starting with version 0.8 | liveOffset | Number (s) | 15 | Allows override default/stream-defined distance from live point for live stream playback (in seconds) | bulkTimedMetadata | Boolean | False | Send timed metadata using single stringified JSON array instead of individual events available starting with version 0.8 | networkProxy | String | - | Network proxy to use (Format <SCHEME>://<PROXY IP:PROXY PORT>) | licenseProxy | String | - | Network proxy to use for license requests (Format same as network proxy) | downloadStallTimeout | Number (s) | - | Optional optimization - Allow fast-failure for class of curl-detectable mid-download stalls (in seconds) | downloadStartTimeout | Number (s) | - | Optional optimization - Allow fast-failure for class of curl-detectable stall at start of download (in seconds) | preferredSubtitleLanguage | String | en | ISO-639 language code used with VTT OOB captions | parallelPlaylistDownload | Boolean | True | Optional optimization – download audio and video playlists in parallel for HLS; available starting with version 0.8 | parallelPlaylistRefresh | Boolean | True | Optionally disable audio video playlist parallel download for linear (only for HLS) | useAverageBandwidth | Boolean | False | Optional Average bandwidth for ABR switching ( version 1.0) | preCachePlaylistTime | Number (s) | - | Optionally enable PreCaching of Playlist and TimeWindow for Cache(minutes) ( version 1.0) | progressReportingInterval | Number (s) | 1 | Optionally change Progress Report Interval (in seconds) | useRetuneForUnpairedDiscont inuity | Boolean | True | Optional unpaired discontinuity retune config ( version 1.0) | drmDecryptFailThreshold | Number | - | Optional pre-tune buffering (in seconds) before playback start (version 2.4) | useMatchingBaseUrl | Boolean | False | use DASH main manifest hostname to select from multiple base urls in DASH (when present). By default, will always choose first (version 2.4) | initFragmentRetryCount | Number | 1 | Maximum number of retries for MP4 header fragment | nativeCCRendering | Boolean | False | Use native ClosedCaption support in AAMP (version 2.6) | langCodePreference | Number | 0 | Set the preferred format for language codes in other events/APIs (version 2.6) NO_LANGCODE_PREFERENCE = 0, 3_CHAR_BIBLIOGRAPHIC_LANGCODE = 1, 3_CHAR_TERMINOLOGY_LANGCODE = 2, 2_CHAR_LANGCODE = 3 | descriptiveTrackName | Boolean | False | Use descriptive audio track naming format which is a combination of - (version 2.6) | authToken | String | - | Optional field to set AuthService token for license acquisition (version 2.7) | useRetuneForGstInternalError | Boolean | True | Optional field to disable propagating URI parameters from Main manifest to segment downloads | reportVideoPTS | Boolean | False | Optional field to enable Video PTS reporting along with progressReport (version 3.0) | propagateUriParameters | Boolean | True | Optional field to disable propagating URI parameters from Main manifest to segment downloads | enableSeekableRange | Boolean | False | Optional field to enable reporting of seekable range for linear scrubbing | maxPlaylistCacheSize | Number | 0 | Optional field to configure maximum cache size in Kbytes to store different profile HLS VOD playlist | setLicenseCaching | Boolean | True | Optional field to disable License Caching in player. By default 3 DRM Sessions are Cached | persistBitrateOverSeek | Boolean | False | To enable AAMP persisting video profile during Seek/Trickplay/Audio switching operation | sslVerifyPeer | Boolean | False | Optional field to enable SSL peer verification | livePauseBehavior | Number | 0 | Optional field to configure player live pause behavior on linear streams when live window touches eldest position. Options: 0 – Autoplay immediate 1 – Live immediate 2 – Autoplay defer 3 – Live defer Default – Autoplay immediate | limitResolution | Boolean | False | Optional field to set maximum video profile resolution based on TV display resolution setting . Default Off. | asyncTune | Boolean | False | Optional field to enable asynchronous player API processing. Application / UI caller threads returned immediately without any processing delays. | useAbsoluteTimeline | Boolean | False | Optional field to enable progress reporting based on Availability Start Time of stream (DASH Only) | sharedSSL | Boolean | True | Optional field to disable sharing SSL context for all download sessions, across manifest, playlist and segments. | disable4K | Boolean | False | Optional field to disable 4K profile playback and restrict only to non-4k video profiles. | preferredAudioRendition | String |
| Optional field to set preferred Audio rendition setting DASH : caption,subtitle,main HLS : GROUP-ID | preferredAudioCodec | String |
| Optional field to set preferred Audio Codec 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. e.g: mp4a.40.2,avc1.4d401e |
setDRMConfig( config ) DRM configuration options are passed to AAMP using the setDRMConfig method. Parameter is JSON object with pairs of protectionScheme: licenseServerUrl pairs, along with preferredKeySystem specifying a preferred protectionScheme.
Background Color |
---|
| Universal Video Engine Player Errors |
Error code | Code | Error String |
---|
AAMP_TUNE_INIT_FAILED | 10 | AAMP: init failed | AAMP_TUNE_INIT_FAILED_MANIFEST_DNLD_ERROR | 10 | AAMP: init failed (unable to download manifest) | AAMP_TUNE_INIT_FAILED_MANIFEST_CONTENT_ERROR | 10 | AAMP: init failed (manifest missing tracks) | AAMP_TUNE_INIT_FAILED_MANIFEST_PARSE_ERROR | 10 | AAMP: init failed (corrupt/invalid manifest) | AAMP_TUNE_INIT_FAILED_TRACK_SYNC_ERROR | 10 | AAMP: init failed (unsynchronized tracks) | AAMP_TUNE_MANIFEST_REQ_FAILED | 10 | AAMP: Manifest Download failed Playlist refresh failed | AAMP_TUNE_INIT_FAILED_PLAYLIST_VIDEO_DNLD_ERR OR | 10 | AAMP: init failed (unable to download video playlist) | AAMP_TUNE_INIT_FAILED_PLAYLIST_AUDIO_DNLD_ERR OR | 10 | AAMP: init failed (unable to download audio playlist) | AAMP_TUNE_FRAGMENT_DOWNLOAD_FAILURE | 10 | AAMP: fragment download failures | AAMP_TUNE_INIT_FRAGMENT_DOWNLOAD_FAILURE | 10 | AAMP: init fragment download failed | AAMP_TUNE_INVALID_MANIFEST_FAILURE | 10 | AAMP: Invalid Manifest, parse failed | AAMP_TUNE_MP4_INIT_FRAGMENT_MISSING | 10 | AAMP: init fragments missing in playlist | AAMP_TUNE_CONTENT_NOT_FOUND | 20 | AAMP: Resource was not found at the URL(HTTP 404) | AAMP_TUNE_AUTHORISATION_FAILURE | 40 | AAMP: Authorization failure | AAMP_TUNE_UNTRACKED_DRM_ERROR | 50 | AAMP: DRM error untracked error | AAMP_TUNE_DRM_INIT_FAILED | 50 | AAMP: DRM Initialization Failed | AAMP_TUNE_DRM_DATA_BIND_FAILED | 50 | AAMP: InitData-DRM Binding Failed | AAMP_TUNE_DRM_SESSIONID_EMPTY | 50 | AAMP: DRM Session ID Empty | AAMP_TUNE_DRM_CHALLENGE_FAILED | 50 | AAMP: DRM License Challenge Generation Failed | AAMP_TUNE_LICENCE_TIMEOUT | 50 | AAMP: DRM License Request Timed out | AAMP_TUNE_LICENCE_REQUEST_FAILED | 50 | AAMP: DRM License Request Failed | AAMP_TUNE_INVALID_DRM_KEY | 50 | AAMP: Invalid Key Error, from DRM | AAMP_TUNE_UNSUPPORTED_STREAM_TYPE | 50 | AAMP: Unsupported Stream Type Unable to determine stream type for DRM Init | AAMP_TUNE_UNSUPPORTED_AUDIO_TYPE | 50 | AAMP: No supported Audio Types in Manifest | AAMP_TUNE_FAILED_TO_GET_KEYID | 50 | AAMP: Failed to parse key id from PSSH | AAMP_TUNE_FAILED_TO_GET_ACCESS_TOKEN | 50 | AAMP: Failed to get access token from Auth Service | AAMP_TUNE_CORRUPT_DRM_METADATA | 50 | AAMP: DRM failure due to Bad DRMMetadata in stream | AAMP_TUNE_DRM_DECRYPT_FAILED | 50 | AAMP: DRM Decryption Failed for Fragments | AAMP_TUNE_DRM_KEY_UPDATE_FAILED | 50 | AAMP: Failed to process DRM key | AAMP_TUNE_CORRUPT_DRM_DATA | 51 | AAMP: DRM failure due to Corrupt DRM files | AAMP_TUNE_DEVICE_NOT_PROVISIONED | 52 | AAMP: Device not provisioned | AAMP_TUNE_HDCP_COMPLIANCE_ERROR | 53 | AAMP: HDCP Compliance Check Failure | AAMP_TUNE_GST_PIPELINE_ERROR | 80 | AAMP: Error from gstreamer pipeline | AAMP_TUNE_FAILED_PTS_ERROR | 80 | AAMP: Playback failed due to PTS error | AAMP_TUNE_PLAYBACK_STALLED | 7600 | AAMP: Playback was stalled due to lack of new fragments | AAMP_TUNE_FAILURE_UNKNOWN | 100 | AAMP: Unknown Failure |
Background Color |
---|
| Inband Closed Caption Management |
To use inband closed captions, first register an event listener to discover decoder handle: Code Block |
---|
| player.addEventListener("decoderAvailable", decoderHandleAvailable); |
Along with corresponding event handler to publish the decoder handle to CC subsystem as follows: Code Block |
---|
| function decoderHandleAvailable(event) {
console.log("decoderHandleAvailable " + event.decoderHandle);
XREReceiver.onEvent("onDecoderAvailable", { decoderHandle: event.decoderHandle });
} |
Toggle CC display on or off at runtime: Code Block |
---|
| XREReceiver.onEvent("onClosedCaptions", { enable: true });
XREReceiver.onEvent("onClosedCaptions", { enable: false }); |
Set CC track at runtime: Code Block |
---|
| XREReceiver.onEvent("onClosedCaptions", { setTrack: trackID }); |
Set CC style options at runtime: Code Block |
---|
| XREReceiver.onEvent("onClosedCaptions", { setOptions: defaultCCOptions}); |
defaultCCOptions is a JSON object of various style options and its values. When closing stream, detach decoder handle: Code Block |
---|
| XREReceiver.onEvent("onDecoderAvailable", { decoderHandle: null }); |
Environments without the XREReceiver JS object may exist in future. Applications may use alternate CC rendering methods to avoid dependency on XREReceiver object. To use, turn on nativeCCRendering init configuration value to true as follows: Code Block |
---|
| player.initConfig( { nativeCCRendering: true } ); |
Toggle CC display on or off at runtime: Code Block |
---|
| player.setClosedCaptionStatus(true);
player.setClosedCaptionStatus(false); |
Get/Set CC track at runtime: Code Block |
---|
| player.getTextTrack();
player.setTextTrack(trackIndex); |
Get/Set CC style options at runtime: Code Block |
---|
| player.getTextStyleOptions();
player.setTextStyleOptions(options); |
options in a JSON formatted string of style options and its values.
ATSC - Unified Video Engine FeaturesSupport for ATSC-UVE is included from 3.0 version. A subset of UVE APIs and Events are available when using UVE JS APIs for ATSC playback.
API MethodsAPIs Supported | Description |
---|
load | URI of the Media to be played by the Video Engine. Optional 2nd parameter. Examples for new URLs Supported: live:///75 – ATSC Channel hdmiin://localhost/deviceid/0 - HDMI Input cvbsin://localhost/deviceid/0 - Composite Input tune://atsc?frequency=5700000&serviceid=3 – Direct tune to ATSC Channel | play | Start Playback / Resume playback. | stop | Stop playback and free resources. | getAudioTrack | Get the index of the currently selected Audio track. | setAudioTrack | Set the index of the Audio track to be selected. | setAudioTrack | Set the Audio track to be selected by Language and Rendition.JSON formatted argument. Example: Code Block |
---|
| {"language":"ger","rendition":"commentary"} |
| setAudioLanguage | Set the language of the Audio track to be selected. | setVideoRect | Set display video rectangle coordinates. Default configuration (0,0,1280,720) | getAvailableAudioTracks | Returns the available audio tracks information in JSON formatted list. Subset of parameters returned Example: Code Block |
---|
| {"name": "English (AC3)","language":"eng","codec":"AC3"} |
| setClosedCaptionStatus | Set the Closed Caption rendering to on/off. | getAvailableTextTracks | Returns the available text track (CC) information in JSON formatted list. Subset of parameters returned - name
- type
- language
- instreamId
Example: Code Block |
---|
| [{"name":"English (Closed Caption)","type":"CLOSED-CAPTIONS","language":
"eng",”instreamId":"CC1"},
{"name":"Spanish (Closed Caption)","type":"CLOSED-CAPTIONS","language":
"spa","instreamId":"CC2"},
{"name":"English (Closed Caption)","type":"CLOSED-CAPTIONS","language":
"eng","instreamId":"SERVICE1"},
{"name":"Spanish (Closed Caption)","type":"CLOSED-CAPTIONS","language":
"spa","instreamId":"SERVICE2"}] |
| getTextTrack | Get the Index of the currently selected Text track. | setTextTrack | Set the Index of the Text track to be selected. | getTextStyleOptions | Returns the JSON formatted string of current ClosedCaption style options and values. | setTextStyleOptions | Set the ClosedCaption style options to be used for rendering. |
New Set of APIs added for ATSC Parental Control Settings disableContentRestrictions (until) - Temporarily disable content restriction based on the control input provided by the ‘until’ parameter.
- Can be used for unlocking a locked channel (Channel locked due to Restrictions set)
Name | Type | Description |
---|
until Code Block |
---|
| {"time": < seconds>} |
Or Code Block |
---|
| {"programChange":true}; |
| Json Object | Provides control for automatic re-locking conditions.
- If ‘time’ is set, the seconds will be considered as relative to current time until which the program will be unlocked.
- If ‘programChange’ is set, the program will be unlocked, but re-enable restriction handling on next program boundary.
- If neither specified, parental control locking will be disabled until set-top reboot, or explicit call to enableContentRestrictions().
- If both specified, parental control locking will be re-enabled depending on which condition occurs first.
|
enableContentRestrictions () - To re-enable parental control locks based on restrictions.
Events Supported Events Supported | Value | Description |
---|
playbackStarted | 1 | Tune Success [OTA , HDMIIN,COMPOSITE IN] | playbackStateChanged | 14 | Event when player state changes. Valid AAMP States for ATSC OTA Playback: : "idle":0, "initializing":1, "initialized":2, "preparing":3, "prepared":4, "playing":8, "blocked":14 Valid AAMP States for HDMIIN :
Code Block |
---|
| "playing":8,“stopped”:10 |
| blocked | 38 | Blocked event is generated when player status switches to eSTATE_BLOCKED. The Event payload is a string to describe the reason for the blocked state. Event Payload: Type : reason – string Reason for restriction Example: “reason”: (ATSC Playback) "STATUS|Low or No Signal" "Service Pin Locked" "STATUS|Unable to decode" If a program is Blocked due to Restrictions set by the Application, the ‘blocked’ event’s reason will be "Service Pin Locked" “reason”: (HDMIIN) "NO_SIGNAL" "UNSTABLE_SIGNAL" "NOT_SUPPORTED_SIGNAL" | bitrateChanged | 11 | Event notified when bitrate change happens. The event payload provides video stream info Will be notified after first tuned event for OTA and and after display settings change. Event Payload: time: number, bitRate: number, description: string, width: number, height: number, framerate: number, position: number(not used), cappedProfile:number (not used), displayWidth:number (not used), displayHeight:number (not used), progressive:bool, aspectRatioWidth:number, aspectRatioHeight:number |
InitConfigProperty | Type | Default Value | Description |
---|
preferredAudioLanguage | String | en | ISO-639 audio language preference; for more than one language, provide comma delimited list from highest to lowest priority: ‘<HIGHEST>,<...>,<LOWEST>’ | nativeCCRendering | Boolean | False | Use native Closed Caption support in AAMP |
|