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
});
Merged into the current settings; last write wins.
The status changed (including later pushes such as shader compile errors).
The OSD shows mpv's message when a shader the plugin set fails to
compile. The player pushes that failure after the set was accepted, so
it arrives through onStatus, not as a rejected call.
const render = plugin.video.render();
render.onStatus((status) => {
if (status.state === "failed") void plugin.osd.show("Render: {}", [status.error.message]);
});
Readonlystatusfailed with unsupported while the player renders in software; failed
with failed when mpv cannot compile a shader (pushed later; while other
plugins' VideoShaders are on too, the player cannot tell whose
shader failed and says so in the message); failed with previous-crash
when a set with a non-empty shaders list comes after a run of the
player that ended abnormally while plugin shaders were drawing (the rules
are the same as for VideoShaders). The handle keeps the refused
list among its values and every set sends them all, so a later set
without shaders is refused again: include shaders: [] in it
(set({ shaders: [], toneMapping: "bt.2390" })); dispose always works.
The GPU renderer's options, from
plugin.video.render(). Single owner, like VideoView; the two are independent handles.Platforms: macOS renders on the GPU by default; Windows does since version 0.5.14 of the player when the user turns on the Picture panel's GPU Rendering (off by default, Rendering). Under software rendering (Windows by default, Linux, headless, fallback) every
setfails withunsupported; SystemInfo.rendering tells which renderer draws without creating the handle. macOS OpenGL 4.1 has no compute shaders, sopeakDetectis accepted but has no effect; output is always SDR.Example: Tone-map HDR video and hide the menu where it cannot work
On a GPU-rendering player HDR video is tone-mapped with BT.2390 for a 250-nit display; under software rendering the plugin hides its HDR menu.
setmerges the values into the plugin's render options and the player reports the result throughonStatus:failedwithunsupportedmeans the player renders in software (Linux, or Windows while GPU rendering is off).Remarks
GPU renderer options (tone mapping, peak detection, shaders, interpolation). Only the GPU renderer has them (macOS; Windows with GPU rendering turned on); under software rendering the handle is
failedwithunsupportedafter the player's first answer torender()(reported toonErrortoo), and so is everyset. Single owner, like VideoView.setnever throws; the result shows instatus. For shaders that several plugins add at the same time, use VideoShaders. After a run of the player that ended abnormally while plugin shaders were drawing, asetwhose merged values hold a non-emptyshaderslist is refused withprevious-crash(the rules are on VideoShaders). Everysetsends all the values set so far, the refusedshadersincluded, so includeshaders: []in the nextsetto go on without them.See
Process video with a shader or a filter
Since
1.0.0