watermark

Package: @playerstack/plugin-watermark (source), not published to npm yet

Pin a small image or text snippet to one corner of the player. Useful for brand logos, copyright lines, or attribution. Optional click-through link, and an opt-in moving mode for viewer identifiers.

Quickstart

Image mode:

<player-stack
  src="https://youtu.be/dQw4w9WgXcQ"
  data-config='{
    "watermark": {
      "enabled": true,
      "src": "https://example.com/logo.svg",
      "position": "top-right",
      "width": 80,
      "opacity": 0.7,
      "href": "https://example.com"
    }
  }'
></player-stack>

Text mode:

<player-stack
  src="https://example.com/v.mp4"
  data-config='{ "watermark": { "enabled": true, "text": "© ACME 2026", "position": "bottom-left" } }'
></player-stack>

Config

config.watermark:

Field Type Default Description
enabled boolean false Plugin is a no-op unless true
src string — Image URL. Mutually exclusive with text
text string — Plain-text overlay. Mutually exclusive with src
href string — Optional click-through URL. Must be http(s); other schemes silently ignored
position "top-left" | "top-right" | "bottom-left" | "bottom-right" "bottom-right" Corner placement
opacity number 0.7 0–1; out-of-range clamped, invalid falls back to default
margin number 16 Distance from corner in px; see bottom corners below
width number 80 Image width in px (image mode only)
moveInterval number off Seconds between moves to a random spot (at least 1). position is then ignored
moveTransition "smooth" | "jump" "smooth" Glide to the next spot (0.8 s) or jump there
reinsert boolean false Put the overlay back if it is removed from the player

Viewer identifier that moves

For paid lessons, the host page can show who is watching and move the label around, so a screen recording points back to the account it was made from. The player prints text exactly as given: it has no placeholders and looks nothing up, so your page (or your backend, for example through the Sellf adapter) must put the final string into the config.

// `buyer` and `lesson` come from your own signed-in session.
const player = document.createElement("player-stack");
player.setAttribute("src", lesson.src);
player.setAttribute(
  "data-config",
  JSON.stringify({
    watermark: {
      enabled: true,
      text: buyer.email,
      opacity: 0.5,
      moveInterval: 10,
      reinsert: true,
    },
  }),
);
document.querySelector("#lesson").append(player);

Build the attribute with JSON.stringify and setAttribute as above, or escape it properly in your server template; do not concatenate viewer data into HTML.

Privacy

An email address or order number on screen is personal data, visible to anyone who can see the screen and present in every screenshot or recording. Whether to show it, what to show (a short order or account ID is often enough) and how to tell viewers is the host’s decision and responsibility. The plugin does not send or store it.

Limits

This is a deterrent, not DRM:

Behavior

Security

Any href that isn’t http: or https: is silently dropped — javascript:, data:, file: etc. won’t render the link wrapper. The overlay still draws.

Events

None.