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

    Type Alias SubtitleStyle

    A subtitle style layer (Subtitles.setStyle). Sizes are at the 1080p reference height and scale with the video. Each plugin has one layer; when several plugins set one, the effective style is the layer of the plugin whose manifest id sorts last (the order of the calls does not matter). It also applies to the secondary subtitle.

    Subtitles turn yellow at size 44 on a 60 % opaque box, 6 % above the bottom of the video, and appear 250 ms earlier. refresh reads the subtitle state from the player, whose fonts lists the font ids a style may name; setStyle then sends this plugin's style layer . It shows unless another plugin with a manifest id that sorts later has a layer too: the player picks the effective layer by manifest id, not by which call came last.

    const { fonts } = await plugin.subtitles.refresh();
    if (!fonts.length) return; // no font to name: leave the style alone
    const style: SubtitleStyle = {
    fontId: fonts[0]!.id, // a font the player offers
    fontSize: 44, // at the 1080p reference height; scales with the video
    color: "yellow",
    outline: 2,
    marginPercent: 6, // bottom margin, % of the video height
    offsetMs: -250, // negative: shown earlier
    box: 60, // background box opacity
    };
    await plugin.subtitles.setStyle(style);

    1.0.0

    type SubtitleStyle = {
        fontId: string;
        fontSize: number;
        color: "white" | "yellow" | "cyan";
        outline: number;
        marginPercent: number;
        offsetMs: number;
        bold?: boolean;
        shadow?: number;
        box?: number | null;
        assOverride?: "keep" | "force";
        secondaryPosition?: "top" | "aboveMain";
    }
    Index
    fontId: string

    A font id from SubtitlesState.fonts.

    fontSize: number

    16–72.

    color: "white" | "yellow" | "cyan"

    Text colour.

    outline: number

    Outline width 0–4.

    marginPercent: number

    Bottom margin 2–15 % of the video height.

    offsetMs: number

    Timing offset in milliseconds, −600000…600000 (±10 minutes); positive shows the subtitles later. Outside the range the player refuses the style with invalid.

    bold?: boolean

    Bold text; default false.

    shadow?: number

    Shadow offset 0–4 at the 1080p reference height.

    box?: number | null

    Background box opacity 0–100; null or omitted: no box (the shadow applies).

    assOverride?: "keep" | "force"

    keep (default): ASS scripts keep their own styling; force: this style replaces it.

    secondaryPosition?: "top" | "aboveMain"

    Where the secondary subtitle sits; default top.