Skip to content

Parameter manifestAcceptor

Description

The manifestAcceptor parameter is used by the Teleport SDK to identify the URL addresses of video stream manifests. This is critically important for the correct operation of the peer-to-peer network, as the SDK must accurately know which request pertains to a manifest.

Default Behavior

By default, the Teleport SDK identifies manifests by their extensions: .m3u8 (for HLS) or .mpd (for DASH).

When is it necessary?

If your media server uses specific or non-standard URL addresses for manifests that do not end with .m3u8 or .mpd, you need to define your own manifestAcceptor function. This function will allow the Teleport SDK to correctly identify manifests.

Example Usage

js
let tlprt = await teleport.initialize({
    apiKey: "YOUR_API_KEY", // Your API key
    loader: {
        type: "PLUGIN_ID", // Identifier of the player plugin used
        params: {
            // Custom function to identify the manifest
            manifestAcceptor: url => url.indexOf(".m3u8") > -1 || url.indexOf("my-custom-manifest-path") > -1
        }
    }
});

In this example, the manifestAcceptor function will consider any URL containing .m3u8 or the string "my-custom-manifest-path" as a manifest.