Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Media Source Extensions (MSE) players such as Shaka Player, Hls.js, and Bitmovin perform CPU-intensive tasks in JavaScript. These include parsing multiple HLS media manifests, which can impact UI responsiveness and fluidity of the app. This impact is noticeable during Live TV playback with large DVR windows that have large manifest sizes. This documentation explains how to optimize performance by leveraging the native implementation of HLS playlist parser. Moving to native parsing offers a significant performance improvement, but there is no requirement for all to switch to native HLS parser support. These optimizations are beneficial for apps handling Live TV playback with large DVR windows as frequent refresh and parsing of large manifests resulting in frequent JS thread blockages, Key events, and UI processing getting delayed. Apps can also use this optimization to improve video startup latencies.

React Native for Vega APIs

You can offload HLS manifest parsing to the native layer using the following functions:

Step 1: Enable native parsing

To enable native parsing, the app must register the native functions by calling registerNativePlayerUtils(). If the device supports native functions, the call returns true, otherwise false. The call registers the app and enables calls to the native HLS parser.

Step 2: Check availability of native support for HLS playlist parsing

To check whether native support for HLS playlist parsing is available for a specific player and player version, call isNativeHlsParserSupported() and pass the following parameters:
  • playerName: Name of the player. Supported values are “shaka” and “hlsjs”.
  • playerVersion: Version of the player. For “shaka” “4.6.18” or “4.3.6”. For “hlsjs” “1.5.11”.
Player versions that support the native HLS parser:
  • ShakaPlayer version “4.6.18” and “4.3.6”
  • Hls.js version “1.5.11”

Step 3: Call the manifest parsing function

The global.parseHlsManifest function implements the HLS manifest parsing. The app must first register itself and then call the parsing function.
To parse the manifest call parseHlsManifest() and pass the following parameters:
  • playerName: A string that contains the player name “shaka”.
  • playerVersion: A string that contains the player version: “4.6.18” or “4.3.6”.
  • absoluteUri: A string that contains the absolute URI of the manifest.
  • manifest: An ArrayBuffer that contains the downloaded manifest.
  • shaka: For ShakaPlayer only, pass the Shaka object as shown in the next section.
The following section provides additional details on the usage of the parameters.

Integration Changes

The following section provides additional details on the usage of the functions shown in the previous steps.
The native HLS parser is supported for the 4.6.18 and 4.3.6 versions of Shaka Player. For information about using the Shaka Player in your app with all the required patches applied, see Play adaptive content (HLS/DASH) with Shaka Player.Note: Before building the player, make sure that the Shaka Player release tarball contains the Shaka-Player-optimizations.patch file and that you have applied it. This enables the hook to register the HLS parsing function. This patch is included starting with the following versions:
  • ShakaPlayer v4.6.18: shaka-rel-v4.6.18-r2.9.tar.gz
  • ShakaPlayer v4.3.6: shaka-rel-v4.3.6-r2.2.tar.gz
To use this functionality, make the following changes in your app’s src/shakaplayer/ShakaPlayer.ts file:
  1. Define the Shaka Player version in src/shakaplayer/ShakaPlayer.ts.
  2. You can define a flag to enable or disable native parsing. As an example, Step 4 to enable native parsing uses the following flag.
  3. Add the call to parseHlsManifest().
  4. Register your implementation of the parseHlsManifest() function before loading Shaka Player. The setNativeFunctions() function allows the app to pass the implementation to the native parseHlsManifest() function. It accepts a function as an argument that Shaka Player calls during HLS Parsing.
    These integration changes are also present in ShakaPlayer.ts that is available as part of externalized release tarball that you can use as a reference.

Supported tags

Shaka Player
  • ShakaPlayer v4.6.18: All tags supported by Shaka Player version v4.6.18.
  • ShakaPlayer v4.3.6: All tags supported by Shaka Player version v4.3.6.
Hls.js Player The following lists contain the supported tags: Media Playlist
  • EXT_X_VERSION
  • EXT_X_TARGETDURATION
  • EXT_X_MEDIA_SEQUENCE
  • EXT_X_DISCONTINUITY_SEQUENCE
  • EXT_X_PLAYLIST_TYPE
  • EXT_X_ENDLIST
Media Segment
  • EXTINF
  • EXT_X_BYTERANGE
  • EXT_X_DISCONTINUITY
  • EXT_X_PROGRAM_DATE_TIME
  • EXT_X_KEY
  • EXT_X_MAP
For the description of these tags, see RFC 8216.

Troubleshooting

  • After integrating changes, if you see the following log entry, nativization is not enabled. To enable it, set the nativization enablement flag. For an example of setting the flag, see step 2 of the ShakaPlayer integration. hlsjs: native playlist parsing is disabled
  • After integrating changes, if you see the following log entry, nativization is not enabled. The most likely cause is that the Vega OS release version is not compatible and doesn’t have the required nativization changes. Make sure that you are using a version that is OS 1.1 (201010432050) or higher. hlsjs: native offload not enabled!

Last modified on February 11, 2026