Skip to content
Docs
Get early access

WirePlayer

A fast, accessible player designed for learning. Adaptive quality, captions, chapters, protection and your brand, from a few lines of code.

WirePlayer is WireVoD’s web player. It plays a lesson from a playback session, adapts quality to every connection, handles content protection automatically and reports playback insights, with an interface built for long-form learning.

Live demo WirePlayer v0.2.0. Try the settings menu, captions, chapters, and ? for shortcuts.
lesson.html
<video id="lesson" playsinline></video>
<script src="https://cdn.jsdelivr.net/npm/video.js@8.24.1/dist/video.min.js"></script>
<script src="https://wirevod.online/player/v0.2.0/wireplayer.min.js"></script>
<script>
const player = new WireVoD.WirePlayer("lesson", {
source: { session: () => fetch("/api/lessons/1/session").then((r) => r.json()) },
title: "Lecture 1 — Introduction",
});
</script>

The player brings its own styles, and loads its protection module from the same location only when a lesson needs it.

source.session is called on every load, including Try again after an error, so it’s the best place to create a fresh session from your backend. The player fills the width of its container at the lesson’s aspect ratio.

OptionDefaultDescription
sourcerequired{ session: () => Promise<session> } or { manifestUrl, telemetryUrl?, entitlementUrl? }
title—Lesson title, shown over the video with the controls
poster—Image shown before playback starts
startTime0Position to start from, in seconds; use it to resume where a learner left off
chapters—[{ start, title }] markers on the progress bar; the current chapter is named in the control bar
captions—[{ src, language, label, kind?, default? }] WebVTT files, in addition to any in the stream
controlstruefalse for no interface, or an object to choose controls (below)
theme—Colours, radius and type (see Theming)
stringsEnglishReplace any interface text to localise the player
skipSeconds10Jump for the skip buttons, J/L and double-tap
playbackRates0.5–2Speeds offered in the settings menu
keyboardtrueKeyboard shortcuts while the player has focus
hideControlsAfterMs2500Inactivity before the controls fade during playback
watermark—{ text, opacity?, intervalMs? } moving overlay (see Watermark)
aspectRatio"16:9"Shape of the player box, e.g. "4:3"
autoplay / mutedfalseStart playing immediately (browsers usually require muted)
injectStylestrueSet false if you host wireplayer.css yourself
telemetry.enabledtrueReport playback insights

Every control is on by default. Turn off what your product doesn’t need:

lesson.js
new WireVoD.WirePlayer("lesson", {
source,
controls: { seekButtons: false, pip: false, speed: false },
});

Available keys: play, seekButtons, volume, time, progress, captions, settings, quality, speed, pip, fullscreen. On narrow screens the player hides the skip buttons and picture-in-picture automatically; learners double-tap the sides of the video to skip instead.

Match the player to your product with theme, or change it later with player.setTheme():

lesson.js
new WireVoD.WirePlayer("lesson", {
source,
theme: { accent: "#0f9d58", radius: "10px", fontFamily: "Poppins, sans-serif" },
});

Every value is also a CSS custom property, so you can theme from your stylesheet:

styles.css
.wp {
--wp-accent: #0f9d58;
--wp-radius: 10px;
}
Theme keyCSS propertyDefaultControls
accent--wp-accent#2d5bffProgress, selections, large play button
accentForeground--wp-accent-fg#ffffffIcon on the large play button
foreground--wp-fg#ffffffIcons and text over the video
surface--wp-surfacenear-blackMenus, tooltips and previews
radius--wp-radius3pxButtons, menus and the large play button
fontFamily--wp-fontInter, system UIAll player text
iconSize--wp-icon22pxControl icons
progressHeight--wp-progress3pxProgress bar at rest
scrimOpacity--wp-scrim0.72Shade behind the controls

Captions in the stream appear automatically. Add more with captions; learners switch them with the CC button, C or the settings menu. When captions first turn on, the player picks the track that matches the page language.

lesson.js
new WireVoD.WirePlayer("lesson", {
source,
captions: [
{ src: "/captions/lesson-1.en.vtt", language: "en", label: "English" },
{ src: "/captions/lesson-1.ar.vtt", language: "ar", label: "العربية" },
],
chapters: [
{ start: 0, title: "Introduction" },
{ start: 312, title: "Worked example" },
{ start: 840, title: "Summary" },
],
});

For paid courses, a watermark tying each view to a learner discourages screen recording. Pass text such as the learner’s email; it moves to a new position at an interval and returns if removed from the page.

lesson.js
new WireVoD.WirePlayer("lesson", {
source,
watermark: { text: learner.email, opacity: 0.3, intervalMs: 15000 },
});

Combine it with content protection, which prevents downloading the video itself.

Shortcuts work while the player has focus. Press ? in the player to see them.

KeysAction
K or SpacePlay or pause
J / LBack or forward skipSeconds
← / →Back or forward 5 seconds
↑ / ↓Volume up or down
MMute or unmute
CCaptions on or off
< / >Slower or faster
0–9Jump to 0–90% of the lesson
FFull screen
PPicture-in-picture

Every control is reachable with Tab, the progress and volume bars are sliders with arrow keys, and the settings menu works with arrow keys and Escape.

Pass strings to replace any interface text. Unspecified strings stay in English.

lesson.js
new WireVoD.WirePlayer("lesson", {
source,
strings: { play: "تشغيل", pause: "إيقاف مؤقت", settings: "الإعدادات", quality: "الجودة", speed: "السرعة" },
});
MethodDescription
ready()Promise that resolves when the lesson is loaded
play() / pause()Control playback
seek(seconds)Move to a position
currentTime() / duration()Position and length in seconds
setVolume(0–1) / setMuted(bool)Sound
setPlaybackRate(rate)Speed, e.g. 1.5
qualities() / setQuality(id)List qualities; pin one ("720p") or return to "auto"
captions() / setCaptions(id | null)List caption tracks; show one or hide captions
enterFullscreen() / exitFullscreen()Full screen
setTheme(theme)Change theme values at runtime
reload()Fetch a fresh session and continue from the same position
on(event, listener)Subscribe to an event; returns an unsubscribe function
destroy()Send remaining insights and remove the player
EventPayload
ready—
play / pause—
timeupdate{ currentTime, duration }
seeked{ currentTime }
startup{ startupMs }: time from pressing play to the first frame
stall{ playheadMs }: playback paused to wait for data
qualitychange{ rendition, bitrateKbps? }
ratechange{ rate }
volumechange{ volume, muted }
captionschange{ language }, or null when captions turn off
fullscreenchange{ fullscreen }
error{ code, message? }; see Content protection for drm_* codes
ended—

When playback fails, the player shows a clear message to the learner with a Try again button. Listen to error to add your own handling:

lesson.js
player.on("timeupdate", ({ currentTime }) => saveProgress(lessonId, currentTime));
player.on("error", ({ code }) => reportToSupport(code));