- β Branding stays visible
- β Content is traceable
- β Users are discouraged from unauthorized sharing
- β You can bind each playback session to a specific user or device
Quick start (copy/paste)
- Copy the config below and set the
textvalues for your brand + user/session identifier. - Run
encodeWatermarkConfig(config)in your app/console to get the Base64 string. - Append
&watermark=<Base64>to your Vidinfra player URL (see embed example). - Paste the iframe snippet into your page and adjust sizing if needed.
- Verify playback: the watermark should be visible, readable, and moving every few seconds.
Prerequisites
- A Vidinfra player URL (e.g.,
https://player.vidinfra.com/.../default/...). - A way to identify the viewer (user ID, email hash, session ID).
- Ability to run a small JS helper to encode the watermark payload.
Watermark Configuration Example
Below is an example configuration with a static brand watermark ("MyVideoApp") and a dynamic user watermark ("User: 1827439") that moves every 3.5 seconds.
Property Breakdown
| Property | Description |
|---|---|
text | Content displayed (brand name, user ID, etc.) |
font | Font family |
fontSize | Text size (px) |
fillStyle | Text color and opacity |
strokeStyle | Outline for visibility |
padding | Space between watermark and video edges |
opacity | Transparency level |
moveIntervalMs | Movement frequency for dynamic watermark |
Encoding Watermark Configuration
Convert the configuration to Base64 to embed in the player URL.Tip: In Node, replacebtoawithBuffer.from(jsonString).toString("base64").
Generated Base64 Output
Use this encoded value in your player URL:W3sidGV4dCI6Ik15VmlkZW9BcHAiLCJmb250IjoiQXJpYWwiLCJmb250U2l6ZSI6MjAsImZpbGxTdHlsZSI6InJnYmEoMjU1LDI1NSwyNTUsMC44KSIsInBhZGRpbmciOjgsIm9wYWNpdHkiOjAuOX0seyJ0ZXh0IjoiVXNlcjogMTgyNzQzOSIsImZvbnQiOiJSb2JvdG8iLCJmb250U2l6ZSI6MTgsImZpbGxTdHlsZSI6InJnYmEoMjU1LCAyNTUsIDI1NSwgMC42KSIsInN0cm9rZVN0eWxlIjoicmdiYSgwLCAwLCAwLCAwLjMpIiwicGFkZGluZyI6Niwib3BhY2l0eSI6MC44NSwibW92ZUludGVydmFsTXMiOjM1MDB9XQ==
Embedding the Watermark Into the Player
Add the Base64 configuration to thewatermark= parameter of your player URL.
Minimal iframe template (ready to paste)
Dynamic user binding example
Embed Vidinfra videos using iframe elements
- Copy the iframe snippet above into your page.
- Replace the
srcwith your Vidinfra player URL and includewatermark=<Base64>to apply your encoded config. - Adjust container sizing (e.g.,
padding-bottomfor aspect ratio) to fit your layout. - Keep
allowfullscreenenabled so viewers can expand the video.
Best practices
- Use
encodeURIComponenton the Base64 string when appending it to URLs. - Prefer semi-transparent fill plus a light stroke for readability on varied backgrounds.
- Set
moveIntervalMsbetween 2500β5000 for good movement without distraction. - Avoid PII: use a user ID or hashed email instead of raw email when possible.
- Keep opacity >0.6 so the watermark stays visible on bright scenes.
Troubleshooting
- Watermark not visible: increase
opacity, addstrokeStyle, or enlargefontSize. - URL rejected or broken: ensure the
watermarkvalue is URL-encoded. - Movement too subtle: reduce
moveIntervalMsor increasefontSize. - Layout issues: adjust the wrapperβs
padding-bottomto match your aspect ratio (e.g., 56.25% for 16:9).
Quick verification checklist
- The iframe loads and plays the video.
- Watermark shows both brand and user text.
- Watermark moves on an interval.
- Fullscreen works and watermark remains visible.
- β Stronger anti-piracy protection
- β User-specific traceability
- β Branding visibility
- β Hard-to-remove movement-based watermarking