Provides an accessible multimedia player for embedding video and audio into web pages.
The multimedia player requires the use of a few HTML5 tags and a link to the media source you wish to embed.
The media player supports several formats, listed below; however, we recommend at a minimum you provide any video media in MPEG4 (using the H264 and AAC codecs) to be able to reach every audience, as all mobile players and most browsers are able to play this format. We also recommend you provide media in the WebM format (using the VP8 codec) in addition to MPEG4 in order to take advantage of native browser support, for example Firefox.
<figure> using the wb-mltmd class:
<figure class="wb-mltmd">
<video> or <audio> tag.figure element:
data-wb-mltmd='{"shareUrl": "url"}'
figcaption element to the figure element with the title of the video or audio file. If a transcript is required, then also include either a link to the transcript or a details/summary containing the transcript.
<figcaption>
<p>Looking for a Job</p>
</figcaption>
<figcaption>
<p>Looking for a Job (<a href="cpts-lg-en.html">Transcript</a>)</p>
</figcaption>
<figcaption>
<details id="inline-captions">
<summary>Looking for a Job - HTML5 Transcript/Captions</summary>
<p class="wet-boew-vd"><strong>(Animated pen draws a red line that leads into the text Looking for A Job)</strong></p>
<p class="wet-boew-vd"><strong>(Cut to a medium shot of the Host. LINE DRAWING GRAPHIC: Stick person appears and waves.)</strong></p>
<p><span class="wb-tmtxt" data-begin="2.50s" data-dur="3.84s">Hi, my name is Eric, and I'm a Service Canada employee.</span></p>
...
</details>
</figcaption>
poster attribute to the video element with the value being the URL for the thumbnail image.title attribute to the video element with the value being the title of the video.source elements to the video element with the src attribute value being the URL of the media file and the type attribute being the media file MIME type.<source type="video/webm" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.webm" />
<source type="video/mp4" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.mp4" />
track element with kind="captions" to the video element to add captions.
srclang and label attributes to the track element to identify the captions language.
<track srclang="en" label="English" />
src and data-type attributes to the track element to identify the source of the captions.
data-type="application/ttml+xml" and src is the URL of the Timed Text Markup Language captions file.data-type="text/html" and src is the URL of the HTML captions file.data-type="text/html" and src is the URL of the inline HTML captions (e.g., src="#inline-captions".<track src="cpts-lg-en.html" kind="captions" data-type="text/html" srclang="en" label="English" />
button element within the figure container.<button class="btn btn-info cuepoint" data-cuepoint="75s">Cue point - 75s</button>
<button class="btn btn-info cuepoint" data-cuepoint="01:15">Cue point - 01:15</button>
<figure class="wb-mltmd" data-wb-mltmd='{"shareUrl": "https://wet-boew.github.io/v4.0-ci/demos/multimedia/multimedia-en.html"}'>
<video poster="demo/video1-en.jpg" title="Looking for a Job">
<source type="video/webm" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.webm" />
<source type="video/mp4" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.mp4" />
<track src="cpts-lg-en.html" kind="captions" data-type="text/html" srclang="en" label="English" />
</video>
<button class="btn btn-info cuepoint" data-cuepoint="75s">Cue point - 75s</button>
<figcaption>
<p>Looking for a Job (<a href="cpts-lg-en.html">Transcript</a>)</p>
</figcaption>
</figure>
title attribute to the video element with the value being the title of the video.Add a source element to the video element with type="video/youtube" and the src attribute being the URL of the video.
<source type="video/youtube" src="https://www.youtube.com/watch?v=9znKJqnFuuY" />
or
<source type="video/youtube" src="https://youtu.be/9znKJqnFuuY" />
<figure class="wb-mltmd">
<video title="Suspect">
<source type="video/youtube" src="https://www.youtube.com/watch?v=9znKJqnFuuY" />
</video>
<figcaption>
<p>Suspect</p>
</figcaption>
</figure>
title attribute to the audio element with the value being the title of the audio.source elements to the audio element with the src attribute value being the URL of the media file and the type attribute being the media file MIME type.<source src="https://www.archive.org/download/RideOfTheValkyries/ride_of_the_valkyries_2.mp3" type="audio/mp3" />
<source src="https://www.archive.org/download/RideOfTheValkyries/ride_of_the_valkyries_2.ogg" type="audio/ogg" />
<figure class="wb-mltmd">
<audio title="Ride of the Valkyries">
<source src="https://www.archive.org/download/RideOfTheValkyries/ride_of_the_valkyries_2.mp3" type="audio/mp3" />
<source src="https://www.archive.org/download/RideOfTheValkyries/ride_of_the_valkyries_2.ogg" type="audio/ogg" />
</audio>
<figcaption>
<p>Ride of the Valkyries</p>
</figcaption>
</figure>
| Option | Description | How to configure | Values |
|---|---|---|---|
shareUrl |
Adds a "Share this video" or "Share this audio file" link | Add to the element with class="wb-mltmd". |
|
| Event | Trigger | What it does |
|---|---|---|
wb-init.wb-mltmd |
Triggered manually (e.g., $( ".wb-mltmd" ).trigger( "wb-init.wb-mltmd" );). |
Used to manually initialize the multimedia player. Note: The multimedia player will be initialized automatically unless the multimedia player markup is added after the page has already loaded. |
wb-ready.wb-mltmd (v4.0.5+) |
Triggered automatically after a multimedia player initializes. | Used to identify which multimedia player initialized (target of the event)
|
wb-ready.wb (v4.0.5+) |
Triggered automatically when WET has finished loading and executing. | Used to identify when all WET plugins and polyfills have finished loading and executing.
|