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

    Variable SUBTITLE_LIMITSConst

    SUBTITLE_LIMITS: Readonly<
        {
            fileBytes: number;
            tracksPerPlugin: 4;
            tracks: 16;
            totalBytes: number;
            loadsPerPlugin: 16;
            loads: 128;
            uploadsPerPlugin: 2;
            uploads: 8;
        },
    > = ...

    The player's limits on subtitle files a plugin loads with Subtitles.load, which TestHost enforces with the player's codes. The track counts are per source: opening another file starts from zero. A file over fileBytes fails with invalid; every other limit fails with busy, and nothing is loaded.

    Each load uses a new resource on the source, and removing the track frees its place among the live tracks (tracksPerPlugin, tracks, totalBytes) but not among the loads (loadsPerPlugin, loads). So one plugin loads at most 16 files into one source, with at most 4 of them present at once.

    The plugin keeps the files it loaded, newest last, and removes the oldest before a fifth would be refused with busy. A load the player still refuses (the source holds 16 tracks of every plugin, or this plugin already loaded 16 files into it) is reported on the OSD.

    import { SUBTITLE_LIMITS } from "@vestra-player/sdk/testing";

    const loaded: SubtitleTrack[] = []; // this source's, newest last
    if (loaded.length >= SUBTITLE_LIMITS.tracksPerPlugin)
    await plugin.subtitles.remove(loaded.shift()!);
    try {
    loaded.push(await plugin.subtitles.load(bytes));
    } catch (error) {
    if ((error as PluginError).code !== "busy") throw error;
    await plugin.osd.show("No room for another subtitle on this file.");
    }

    1.5.34