- 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
Make the following modifications to your Shaka player to run with Vega.-
Pollyfill 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 pollyfill. As the Video RN component is created and destroyed,
global.gvideois set or cleared. Example: -
Disable the Node interface in
xml_util.js. Example:
Dash.js player
Make the following modifications to your dash.js player to run with Vega.-
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 configs (CUE API is not supported).
- Patch the
SourceBuffer.appendBuffermethod to acceptUint8Array. - Disable workers (web workers (background process) is unsupported).

