Multimedia Player - Video
Looking for WET v3.1?
As of September 23, 2014, version 3.1 of the Web Experience Toolkit is no longer supported. The source code and documentation have been moved to the wet-boew-legacy repository.
Overview
For video, the multimedia player leverages the native HTML5 video
tag and relies on Flash as a fallback mechanism when the HTML5 video
tag is not implemented. The MPEG 4 format (H264 codec) is the minimum requirement for video because the Flash fallback relies on it and H264 is the standard video format on many mobile devices. An optional but highly recommended Webm (VP8 codec) should be added as well to allow some browsers such as Firefox that do not include native support for H264 to leverage the native HTML5 performance gains.
The multimedia player's timeline relies on the HTML5 progress
element and uses a polyfill when the element is not supported.
Examples
The first two video examples use native HTML5 video on most modern browsers including Firefox 6+, Google Chrome 3+ and IE9. The third video example works natively in some browsers but relies on the Flash fallback for Firefox. For all examples, the Flash fallback is used for IE8 as well as older versions of Firefox.
MPEG4 (H264 + AAC) and WebM (VP8) source and HTML captions
View code
In-page HTML
<figure class="wb-mltmd" data-wb-mltmd='{"shareUrl": "http://youtu.be/p2-1ZIHu1W0"}'>
<video poster="http://www.servicecanada.gc.ca/eng/video/images/te-lj-eng.jpg" title="Looking for a Job">
<source type="video/webm" src="http://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.webm" />
<source type="video/mp4" src="http://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>
<figcaption>
<p>Looking for a Job (<a href="http://www.servicecanada.gc.ca/eng/video/lj.shtml">Transcript</a>)</p>
</figcaption>
</figure>
cpts-lg-en.html
<div id="inline-captions">
<section>
<h2>Transcript</h2>
<p class="wb-vd"><strong>(Animated pen draws a red line that leads into the text Looking for A Job)</strong></p>
<p class="wb-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>
...
</section>
</div>
MPEG4 (H264 + AAC) and WebM (VP8) source and HTML captions
View code
In-page HTML
<figure class="wb-mltmd" data-wb-mltmd='{"shareUrl": "http://youtu.be/jmNmrubTNI4"}'>
<video poster="http://www.servicecanada.gc.ca/eng/video/images/dc-td-eng.jpg" title="Training and Development">
<source type="video/webm" src="http://video2.servicecanada.gc.ca/video/boew-wet/dc-td-eng.webm" />
<source type="video/mp4" src="http://video2.servicecanada.gc.ca/video/boew-wet/dc-td-eng.mp4" />
<track src="cpts-lg2-en.html" kind="captions" data-type="text/html" srclang="en" label="English" />
</video>
<figcaption>
<p>Training and Development (<a href="http://www.servicecanada.gc.ca/eng/video/td.shtml">Transcript</a>)</p>
</figcaption>
</figure>
cpts-lg2-en.html
<div id="inline-captions">
<section>
<h2>Transcript</h2>
<p class="wb-vd" data-load="vd"><strong>(Animated pen draws a red line that leads into the text Training and development.)</strong></p>
<p><span class="wb-tmtxt" data-begin="1.40s" data-dur="3.33s" data-load="tt">Hi, my name is Eric, and I'm a Service Canada employee.</span></p>
<p class="wb-vd" data-load="vd"><strong>(Cut to a close-up of the Host.)</strong></p>
...
</section>
</div>
MPEG4 (H264 + AAC) source with inline HTML captions
This example illustrates the use of an inline transcript to provide captions. This example can also demonstrate the fallback mechanism in Web browsers that don't support HTML5 videos.
View code
<figure class="wb-mltmd">
<video poster="http://www.servicecanada.gc.ca/eng/video/images/te-lj-eng.jpg" title="Looking for a Job">
<source type="video/mp4" src="http://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.mp4" />
<track src="#inline-captions" kind="captions" data-type="text/html" srclang="en" label="English" />
</video>
<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>
</figure>
MPEG4 (H264 + AAC) source with cue points
This example illustrates the use of buttons to navigate to specific cue points within the video.
View code
<figure class="wb-mltmd">
<video poster="http://www.servicecanada.gc.ca/eng/video/images/te-lj-eng.jpg" title="Looking for a Job">
<source type="video/mp4" src="http://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.mp4" />
<track src="#inline-captions" kind="captions" data-type="text/html" srclang="en" label="English" />
</video>
<button class="btn btn-info cuepoint" data-cuepoint="45s">Cue point - 45s</button>
<button class="btn btn-info cuepoint" data-cuepoint="01:10">Cue point - 01:10</button>
<figcaption>
<p>Looking for a Job (<a href="http://www.servicecanada.gc.ca/eng/video/lj.shtml">Transcript</a>)</p>
</figcaption>
</figure>
- Date modified: