<video controls preload="auto" poster="poster.png">
<source src="trailer.mp4" type='video/mp4'>
<source src="trailer.webm" type='video/webm'>
<track kind='subtitles' src='brave.en'
srclang='en' label="English">
<track kind='captions' src=brave_bis.en.vtt'
srclang='en' label="English for the Hard of Hearing">
<track kind='subtitles' src='brave.fr.vtt'
srclang='fr' label="Français">
<p>Your user agent does not support the HTML5 Video element.
</video>
Fine-grained control: app developer constructs media stream from a series of video or audio chunks.
Use cases
Adaptive streaming (when various resolutions available from server)
Ad-insertion
Time-shifting
Video editing
Even when single stream, can improve performance by allowing parallel downloads of chunks that are recombined
Also works with live streams
We expect to see innovation in adaptive algorithms.
Encrypted Media Extensions
W3C has a proposal for an API to control playback of protected content.
Connects Content Management System (CMS) to content provider serving encrypted media
Challenges to this approach:
Opacity of existing CMS
Assumes interoperability between CMS and service delivering the key.
Relationship with others is work in progress:
Canvas, CSS
Assistive technology
Real Time Communications
Peer Connection
P2P Channel for video, audio, data
Codec control
Encryption
Bandwidth management
Session setup (signaling)
DataChannel
ICE, SDP
Performance
See Steve if you're using too much video on your page :-)
Measurements
Saving power
Navigation Timing
client-side latency measurements within applications
function onPlay() {
var now = new Date().getTime();
alert("User-perceived autoplay loading time: "
+ now - performance.timing.navigationStart);
}
video.addEventListener("play", onPlay, false);
fetchStart, requestStart, responseEnd, etc.
Page Visibility
Determine the current visibility of a page
document.hidden
document.addEventListener('visibilitychange', ...);
function onvisibilitychange() {
if (document.hidden)
video.pause();
else
video.play();
}
requestAnimationFrame
Script-based animations where the user agent is in control of limiting the update rate of the animation
function animate(time) {
if (!document.hidden) {
// if visible, draw
canvas.drawImage(myVideoElement, 0, 0);
}
window.requestAnimationFrame(animate);
}
function start() {
window.requestAnimationFrame(animate);
}