Release the resource. Resolves once the player confirmed the release (or immediately for purely local resources). Never rejects.
A "Turn feature off" item removes the feature's own menu item at once,
before the plugin stops. dispose takes the command out of the menu and
the binding table and resolves once the player confirmed it; the id can
be added again later.
const extra = plugin.commands.add({ id: "extra", path: ["Tools", "Extra"], run() {} });
plugin.commands.add({
id: "extra-off",
path: ["Tools", "Turn extra off"],
run: () => extra.dispose(), // never rejects
});
Show the block with this text, change it, or hide it.
The text, with \n between lines: at most 32 lines and
4096 bytes once translated and formatted. null hides the block. A
template, like Osd.show's.
Optionalargs: TemplateArgs | null
Values for its placeholders; null or omitted for none.
Optionaloptions: OsdPanelOptions
maxColumns: cut long lines.
Latest value wins: calling it on every state change is fine, the same
text is not sent twice and only the newest text is sent while a write is
in flight. Never throws; a failed write goes to Scope.onError
(invalid for too much text, unavailable without a user interface).
The block shows "A: 12.0 s" and "B: 18.5 s" on two lines, then
disappears. The text is a template the player translates and fills
in; \n separates lines, and null hides the block.
const info = plugin.osd.panel();
info.set("A: {} s\nB: {} s", ["12.0", "18.5"]);
info.set(null); // hide it
This plugin's information block on the OSD: multi-line text over the video that stays until the plugin changes or removes it. Made by Osd.panel.
Remarks
The block sits under the OSD message line, on a translucent dark plate (see Osd for sizes), and takes no input. When several plugins have one, they are stacked from top to bottom.
dispose(), disposing the scope or stopping the plugin removes it.Example: Show live playback numbers over the video
A block over the video shows the position and the duration, updated as playback moves, while the user has it switched on. A stream's listener runs after the SDK updated the state;
setnever throws and sends only the newest text while one is in flight, so calling it on every change is fine. The stream lives only while the block shows, so the plugin can be stopped while it is off.Since
1.0.0