The player sends an event as one JSON line {"event": name, "data": …}, only to plugins that subscribed to that name. Every event reaches a plugin from its first listener. The SDK subscribes for you when a member listens (a watcher such as MainWindow.onChange, a state stream, a media handle's ready). Which way to learn a state (a read, an event, a trigger or a stream) is in Learn what happens in the player without staying up. plugin.player.on(event, listener) listens to a name directly, typed by EventPayloads; plugin.wire.on does the same untyped.
source.state says stamp.generation where PlayerState says sourceId). The three source events, source.opening, source.ready and source.ended (SourceEvent, typed by SourceEventPayloads), are the exception: their state is the SDK's PlayerState. Each is sent once per thing that happened to a source; for one source the order is opening, ready (none when it could not be opened), ended, and a replaced source's ended comes before the next one's opening. The facts that changed (FactEvent, typed by FactEventPayloads) are each sent once per change; audio.tracks.changed, subtitles.changed, window.changed and layout.changed reach the listener in the SDK's shape.plugin.player.state, plugin.window.state, the layout, the timeline, the appearance) follows the event only while a listener, a watcher (onChange) or a stream holds it; otherwise the copy is the newest value the plugin read, and a bound value that reads it shows that. "no": the copy follows from its first use.| Event | Payload | SDK members that listen to it | Wakes a stopped plugin | Copy follows only while held |
|---|---|---|---|---|
source.state |
SourceState: The player's source: phase, position, rate, volume, its stamp (what PlayerState is made from). |
Subtitles.onChange, Plugin.video.filter |
no | yes |
playback.backend |
{ currentSession: number; event: string }: A playback backend event: the backend's name for it (event) and the source generation it belongs to. |
none: Player.on only |
no | yes |
window.state |
WindowFacts: The main window: fullscreen, maximized, video area, picture-in-picture (what WindowState is made from). |
MainWindow.onChange, PanelSlot.onChange, Panel.onChange, BackdropSlot.onChange |
no | yes |
packages.changed |
PackageInfo[]: Every installed plugin, after an install, an uninstall or a change of one. |
Packages.onChange |
yes | no |
bindings.changed |
null: A key binding changed somewhere; read them again with plugin.bindings.list(). |
Bindings.onChange |
yes | no |
commands.keys |
CommandKeys: The key labels of this plugin's own commands, with the binding table's revision. |
Commands.keys |
yes | no |
timeline.changed |
WireTimeline: Every timeline mark and range, after any plugin or the player changed one. |
none: Player.on only |
no | yes |
appearance.changed |
{ theme: string; language?: string }: The palette changed (theme), or the interface language the user saved (language; the oldest players send no language). |
none: Player.on only |
yes | yes |
resolvers.fileTypes |
{ fileTypes: string[] }: The file extensions the plugins' file resolvers claim now. |
none: Player.on only |
yes | yes |
video.upscaling.changed |
Omit<WireUpscalingState, "enabled">: The AI upscaling state, without this plugin's own enabled. |
VideoUpscaling.onChange |
no | no |
video.motion.changed |
Omit<WireMotionState, "mode">: Motion smoothing's state, without this plugin's own mode. |
VideoMotion.onChange |
no | no |
source.opening |
{ state: PlayerState; previous: { sourceId: number } | null }: A new source starts to open (also the same file again, and Player.restart). state is the player's state at that moment, as a PlayerState (pass it as ifCurrent or to Player.isCurrent); previous names the source that was open before it, null when nothing was. |
none: Player.on only |
yes | no |
source.ready |
{ state: PlayerState }: The source is loaded: its duration, tracks and seekability are known. Once per opening, after its source.opening. |
none: Player.on only |
yes | no |
source.ended |
{ state: PlayerState; reason: "natural" | "stopped" | "replaced" | "error" | "quit"; error?: string }: A source left playback: it played to its end (natural), was closed (stopped), another source took its place (replaced), it could not be played (error, with the failure text in error), or the player quits (quit, sent only to a plugin that is running then). state is that source's last state, with its last position, not the player's current one. |
none: Player.on only |
yes | no |
video.reconfigured |
{ sourceId: number; width: number; height: number; displayWidth: number; displayHeight: number; fps: number | null; rotation: number; hdr: boolean }: The decoded video's parameters changed: a new source's video is known, or a rotation, a crop or another filter changed the size it is shown at. Once to a few times per file; not for a source without video. |
none: Player.on only |
yes | no |
audio.reconfigured |
{ sourceId: number; sampleRate: number; channels: number | null; format: string | null }: The decoded audio's parameters changed: a new source's audio is known, another track plays, or the output was opened again. Not for a source without audio. |
none: Player.on only |
yes | no |
audio.tracks.changed |
{ sourceId: number; audioTracks: AudioTrack[] }: The current source's audio track list or its selected track changed: the list of a new source is known, a track was added, another was selected. Not when the list goes away (a source closes or a new one loads; source.ended and source.opening say so). |
none: Player.on only |
yes | no |
subtitles.changed |
{ state: SubtitlesState }: The subtitle track list or the primary or secondary selection changed for a loaded source: its tracks are known, a track was loaded or removed, another was selected. state is the subtitle state then; the SDK takes it into plugin.subtitles.state first, so it can be passed as ifCurrent. |
none: Player.on only |
yes | no |
window.changed |
WindowState: The main window's state changed: fullscreen, maximized or picture-in-picture flipped (at once), or its video area changed size (once, when the size has not changed for 300 ms, so a resize gesture sends one event at its end). The SDK takes it into plugin.window.state first. |
none: Player.on only |
yes | no |
layout.changed |
{ slots: { readonly bottom: LayoutPosition | null; readonly sidebar: LayoutPosition | null; readonly adjust: LayoutPosition | null; readonly backdrop: { readonly effective: boolean } | null } }: A panel position was shown or hidden, docked or detached, another tab became active, or a panel came or went. backdrop is the backdrop panel's state, null without one. |
none: Player.on only |
yes | no |
audio.devices.changed |
{ devices: AudioDevice[]; requested: string | null; active: string | null }: The audio output devices changed: one was plugged in or removed, or the device in use changed (setAudioDevice, or the chosen one went away and the system default plays). Checked once a second. The SDK takes requested and active into PlayerState.audioOutput first. |
none: Player.on only |
yes | no |
app.started |
{ version: string; previous: string | null }: The player started: once per run, after its start-up settled, behind everything start-up does. |
none: Player.on only |
yes | no |
Events the player sends without a subscription (commands.execute, ui.callback, ui.closed, and palette.lead to the plugin that holds the palette's lead row, which wakes a stopped plugin: PaletteLead.onRun) are handled by the SDK; plugin.wire.on hears them too. Requests are in Messages.