Skip to main content

JavaScript format stream information

JavaScript format stream information

To retrieve this format, request the URL /info_STREAMNAME.js from the HTTP output (by default port 8080).

The returned data will have an application/javascript mime type and contain a JavaScript code in the following format:

// Generating info code for stream test
if (!mistvideo){var mistvideo = {};}
mistvideo['test'] = {};//The exact same JSON object as in the JSON-based output will be output here.

This format is particularly suited for embedding as a script onto a website.

The mistvideo object is created as an empty object if it does not exist yet, and it is filled with a single entry with the stream name, containing the same JSON object as used in the JSON format. This allows for repeated embedding of one or multiple scripts like these without them conflicting with each other.

JavaScript stream embedding

To retrieve this format, request the URL /embed_STREAMNAME.js from the HTTP output (by default port 8080).

This will produce JavaScript code that is suitable for direct embedding onto a web page. It will attempt to embed the given stream in-line where the script is called, using all default options.

Note that MistServer's web configuration interface can generated embed codes that are more flexible and contain a no-script fallback. It is advisable to use that version instead. This version remains available for legacy compatibility reasons.