PAC Media Player: local MP4
The same player as the YouTube sample: identical markup, styles, and PAC modules, configured for a local MP4 with sideloaded WebVTT captions. Everything stays on this origin, and the features a remote provider cannot offer, captions and picture-in-picture, are available here.
Sample player
Configuration
Only the source differs from the YouTube sample; the behavior described in that page's How It Works applies here unchanged.
- A JSON block in the page head,
script type="application/json" data-pac-media-player-config, supplies the source and caption track. It overridesconfig.jsonsection by section, so the labels and colors still come from that file. - The sample clip and its caption track live in
media/beside the player. The caption track is synthetic, not a transcript: numbered cues that model good captioning practice (at most two lines of at most 42 characters, at most six seconds on screen, line breaks authored at phrase boundaries), cycling six forms: a single line, an authored break, a sound description, a speaker label, italics, and a full two-line cue. Replace both with approved client media before delivery. - The
video-playermarkup is identical to the YouTube page's apart from comments, and the browser suite checks that, so an integrator can copy either page's markup.js/player-config.jscreates avideoelement for this source where the YouTube page gets ayoutube-video.
What a local source makes available
- Captions default on from the sideloaded track; the caption button names its next action,
Turn captions offorTurn captions on, and the browser draws the cues inside the video, above the control bar. - Picture-in-picture is enabled where the browser supports it and reads
Picture-in-Picture unavailablewhere it does not. - Fullscreen uses the video's native presentation on iPhone Safari, where a YouTube iframe cannot go fullscreen. Volume is unavailable on iOS Safari for any source, because only the device buttons set it; the volume slider says so and stays in the accessibility tree, and Mute keeps working.
- No pre-play cover is needed: a local video paints no play button of its own, so the stage shows the first frame.
- The audio-track control stays visible, disabled, and named unavailable because this MP4 has no alternate audio; a source with alternate renditions enables it.
- No request leaves this origin: the clip, the caption file, the runtime, and the styles are all served beside the page.