Plain text on the clipboard; null when it holds none.
A "Paste and play" command opens the address on the clipboard. readText
resolves with the clipboard's text, or null when it holds none (an
image, nothing).
const text = await plugin.clipboard.readText();
if (text?.startsWith("https://")) await plugin.player.open(text.trim());
Replace the clipboard with text (at most 1 MiB of UTF-8).
Replace the clipboard with a PNG or JPEG file (absolute path, at most 16 MB).
invalid (rejects) Not an absolute path, not PNG or JPEG, over
16 MB, or (Windows) an image the system cannot decode.
A frame the plugin saved as PNG is put on the clipboard, ready to paste into another application. The player reads the file and writes the image (macOS: its original bytes; Windows: a bitmap plus PNG).
await plugin.clipboard.writeImage(pngPath); // absolute path, at most 16 MB
await plugin.osd.show("Snapshot copied");
The system clipboard (
clipboard). Unavailable without a user interface.Platforms: macOS writes text as UTF-8 and images as their original PNG/JPEG bytes; Windows writes Unicode text and images as a bitmap plus PNG. Other systems:
unsupported. Failures:invalid,missing,unavailable,failed(the system refused).Example: Copy the current file and position
The clipboard holds "path @ seconds" for pasting into a note. The player writes the system clipboard; it rejects with
unsupportedon systems other than macOS and Windows andfailedwhen the system refuses, which the plugin reports.Remarks
The player reads and writes the system clipboard on the plugin's behalf. Text is plain text; images are written from a PNG or JPEG file.
Since
1.0.0