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

    Variable COMMAND_LIMITSConst

    COMMAND_LIMITS: {
        perPlugin: 160;
        total: 1024;
        depth: 8;
        idBytes: 128;
        titleBytes: 128;
        segmentBytes: 80;
        groupBytes: 80;
        categoryBytes: 80;
        reasonBytes: 512;
        order: 1000000;
    } = ...

    The player's command registry caps, the same values as the player's own table (the player's tests check that they agree). They are runaway guards, not product limits: a command added past them is refused by the player with code limit (its ready rejects; during activation, activation fails; later the failure goes to Scope.onError), commands already registered are unaffected, and disposing a command frees its slot at once. TestHost enforces the same caps.

    The other fields are the player's rules for one declaration (since 1.5.48): a command past them is refused with invalid, the same way.

    For menus built from media content (tracks, chapters, presets), set your own sensible display cap well below perPlugin.

    Type Declaration

    • ReadonlyperPlugin: 160

      Commands one plugin instance may have at the same time (160).

    • Readonlytotal: 1024

      Commands of every plugin plus the player's own, together (1024).

    • Readonlydepth: 8

      Segments of a menu path, the leaf included.

      1.5.48

    • ReadonlyidBytes: 128

      UTF-8 bytes of a command's local id: ASCII letters, digits, ., _ and -.

      1.5.48

    • ReadonlytitleBytes: 128

      UTF-8 bytes of a title, a text value counted by its English rendering. Like every command text: not empty, no control characters, no whitespace at either end.

      1.5.48

    • ReadonlysegmentBytes: 80

      UTF-8 bytes of a menu path segment, a text value counted by its English rendering.

      1.5.48

    • ReadonlygroupBytes: 80

      UTF-8 bytes of a group.

      1.5.48

    • ReadonlycategoryBytes: 80

      UTF-8 bytes of a category (CommandOptions.category), a text value counted by its English rendering.

      1.6.4

    • ReadonlyreasonBytes: 512

      UTF-8 bytes of a state's reason, as shown in the player's language.

      1.5.48

    • Readonlyorder: 1000000

      The largest order either way: an order is within ±1,000,000.

      1.5.48

    The Chapters submenu lists at most 50 chapters, however many the file has. Every menu item is a command, and the player counts them per plugin. add itself returns at once and never throws limit: past perPlugin the player refuses the registration, which fails the activation or, later, reaches Scope.onError. A try/catch around add cannot catch that, so a menu built from media content keeps its own cap and leaves room for the plugin's fixed commands.

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

    // 20 slots stay free for the plugin's own commands.
    const shown = chapters.slice(0, Math.min(50, COMMAND_LIMITS.perPlugin - 20));

    1.0.0