With examples from eBaum's World
Right-click, download as.
So what brought about the shift to HTML5 video at all?
<track>
element
WEBVTT
00:00.001 --> 00:04.000
Awwwww yeah.
00:04.001 --> 00:06.000
caption caption caption
00:06.001 --> 00:12.000
You're not limited to one line either
- you can span multiple lines
- just make sure none of those lines are empty
00:12.001 --> 00:16.000
Usually you don't want timestamps that overlap
00:15.000 --> 00:19.000
But it's ok if they do.
WEBVTT
00:00.001 --> 00:03.000
Captions are cool
00:03.001 --> 00:06.000
Especially when styled
00:06.001 --> 00:12.000
Perhaps style each instance of a voice
00:12.001 --> 00:17.000
That way you can make it easier to differentiate
- between when one person's captions
- And another
video::cue(c.blue-text) { color: #b6dae6 }
video::cue(v[voice="John"]) { color: yellow }
video::cue(v[voice="Jane"]) { color: orange }
WEBVTT
slide-1
00:00.001 --> 00:04.000
{
"title": "JSON!",
"description": "This is some awesome JSON. You could manipulate this with JS.",
"image": "images/json.gif",
"href": "http://json.org"
}
var extraInfo = document.querySelector("#extra-info");
var videoElement = document.querySelector("video");
var textTracks = videoElement.textTracks;
var textTrack = textTracks[0]; // since we only have one
textTrack.oncuechange = function (){
var cue = this.activeCues[0];
if (cue) {
var content;
try {
content = JSON.parse(cue.text);
} catch (e) {
return false;
}
console.log(content);
if (content) {
extraInfo.innerHTML = '' +
' '+ content.title +'
' +
'
'+
' '+ content.description +'' +
'';
} else {
extraInfo.innerHTML = '';
}
}
}
To enable the playing of protected videos like feature-length Hollywood films, developers are forced to rely on plugins or non-standard browser extensions. As Adobe supports Open Web development more and more, we need to find a way to provide this capability to developers.
- Joe Steele, Sr. Computer Scientist at Adobe
We recognize the need for the W3C to respond to the changing landscape of the Web and to reconcile the interests of multiple parties. But ratifying EME would be an abdication of responsibility; it would harm interoperability, enshrine nonfree software in W3C standards and perpetuate oppressive business models.
Joint open letter to W3C
None yet
WebRTC is a new front in the long war for an open and unencumbered web.
- Brendan Eich, inventor of JavaScript (via HTML5rocks.com)
And let us know if we can help