Search code examples
javascriptreactjslive-streaming

How to read/get information from live stream manifest


Am running a drm widfine live stream and I like to get some information from the manifest. I found a website:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getManifest#Syntax

but if I run this code I get a: 'browser' is not defined no-undef.

var manifest = browser.runtime.getManifest();
console.log(manifest.name);

Solution

  • If you want to read the manifest file, you can use the manifest URL which you use to load the stream. This link will give you a file with the needed information for the stream, then you use JavaScript to read out the XML file each time a stream is loaded.

    Within the file, you can find the bitrate data. Within your player you should be able to find the bitrate that its currently playing at.

    Read XML file using javascript