@vestra-player/sdk - v1.11.3
    Preparing search index...

    Type Alias ResolvedMedia

    What a resolver returns (WebResolverOptions.resolve): the playable stream(s) behind a page URL. Both streams must use identical headers; different maps fail explicitly (nothing is dropped silently).

    Opening a https://video.example/… page plays it with its title. When the user opens a URL whose scheme and host a web resolver declares, the player calls its resolve(url, signal); the plugin looks up the streams and returns them, and the player plays primary with the separate audio track, sending the headers with every request for both.

    plugin.resolvers.add({
    id: "video-example",
    schemes: ["https"],
    hosts: ["video.example"],
    async resolve(url, signal) {
    // The site's own API (made up here) names the streams of a page.
    const api = `https://video.example/api/streams?page=${encodeURIComponent(url)}`;
    const response = await fetch(api, { signal });
    // The player shows a failed resolve's message to the user.
    if (!response.ok)
    throw new Error(`video.example answered ${response.status} for this page`);
    const info = (await response.json()) as {
    title: string;
    video: string;
    audio: string;
    };
    const headers = { Referer: url }; // identical for both streams
    const media: ResolvedMedia = {
    kind: "media",
    originalUrl: url,
    title: info.title,
    primary: { url: info.video, headers },
    audio: { url: info.audio, headers },
    };
    return media;
    },
    });

    1.0.0

    type ResolvedMedia = {
        kind: "media";
        originalUrl: string;
        title?: string;
        primary: ResolvedResource;
        audio?: ResolvedResource;
    }
    Index
    kind: "media"

    Always "media".

    originalUrl: string

    The page URL that was resolved.

    title?: string

    A title for the player to show.

    primary: ResolvedResource

    The video (or combined) stream.

    audio?: ResolvedResource

    A separate audio stream, when audio and video are split.