- Replace XMLHttpRequest (XHR) objects with the Fetch API.
- Do not use the ReadableStream interface in the Fetch API and use asynchronous full read.
- Work around Document Object Model (DOM) dependencies.
- Implement polyfills where necessary.
Shaka player
To run on Vega, modify your Shaka Player as follows:-
Polyfill the W3CMedia’s Media Source API.
Example:
-
In place of the DOMParser, use the XMLDOM npm package, and specify the window for fetch.
Modified
navigator.userAgentexample: -
Modify the Document object with a polyfill. When you create the React Native video component,
global.gvideois set or cleared. Example: -
Disable the Node interface in
xml_util.js. Example:
Dash.js player
To run on Vega, modify your Dash.js player as follows:-
Before you import any
dash.jsmodules, you must initialize: -
In the
HTTPLoader.js, change the check to use fetch instead ofXMLHTTPRequest. Some checks in the code lead to usage ofXMLHTTPRequest, which couldn’t download the segments (0 byte segments were downloaded). Example:
HLS.js player
Make the following modifications to your HLS.js player to run with Vega.- Apply the same polyfill classes that are applied for the forked Shaka Player to the HLS.js player.
- Polyfill the
location.href,DOMException, andHTMLVideoElementclasses. - Enable the fetch-loader plugin of
hls.js. - In the fetch-loader plugin, disable the
onProgresscallback (fetch.ReadableStreamis not supported). - Disable progressive config (
fetch.ReadableStreamis not supported). - Disable all subtitle configurations (HLS.js player doesn’t support the CUE API).
- Patch the
SourceBuffer.appendBuffermethod to acceptUint8Array. - Disable workers (web workers (background process) is unsupported).

