The video element replaces embedded flash objects. Example: http://jsbin.com/hobeke/1/edit?html,output
It is part of the DOM and can be influenced with javascript and CSS.
Videos from sites like youtube cannot be directly embedded because of commercial reasons, instead use a iframe: https://www.youtube.com/watch?v=ZH1XOsv8OyoGood practice: add text that is displayed in place of the video when the browser does not support the <video> element.
The recommended codec is H264/mp4. For more compatibility provide several versions of your video with different encodings.
Very similiar to the video element. Example: http://jsbin.com/gazoye/8/edit?html,output
Supports sound effects: http://www.w3.org/TR/webaudio/Good practice: propose to download the audio file if the <audio> element is not supported.
Good practice: use preload="none" to avoid unexpected data charges.
Other attributes:
The new HTML5 <track> element is useful for adding closed captions, subtitles, descriptions, and metadata to your videos.
Subtitles are for words whereas closed captions are for general sounds.
.vtt files cannot be linked with a file:// URL.
http://jsbin.com/luyazi/2/edit?html,outputThe WebVTT format is used for subtitles.
http://dev.w3.org/html5/webvtt/ https://developer.mozilla.org/fr/docs/Web/API/Web_Video_Text_Tracks_Formatyellow: Opensource software for video encoding: https://handbrake.fr/
http://www.universalsubtitles.org/Subtitles can be styled: http://jsbin.com/lopudu/5/edit?html,output
Extract from .vtt file:
00:00:06.000 --> 00:00:10.000 line:5%
This cue is positioned at the top of the video
00:00:11.000 --> 00:00:15.000 position:5% align:start
This cue is positioned at the left side of the video.
00:00:16.000 --> 00:00:20.000 position:95% align:end
And this one ate the right side.
To read the whole file find the link in the lopudu5 example above.
Use <v Name> to color code subtitles according to speaker.
Chapters can be defined by setting kind="chapters" in the track element.
A jacascript API is associated with the track element, with it one can navigate the video or modify page content based on video progress.
Example with map that syncs to video (WARNING: starts loading instantly).This example shows how we manage to render music scores in real time as the video plays: http://youtu.be/JyNSyL-MmFI
Using a plain video element should be the default choice as the video element is more flexible and consumes less of the users resources.
Project 1 (very easy): prepare a Web page somewhere that uses some of the enhanced players, and write some explanations on how you created the page (JavaScript files to include, options to choose from, etc.)
Project 2 (more work): make a video of yourself that explains how you made the video, added subtitles, chose the player, hosted the files, etc.
Set the src of a video element to the video stream coming from the webcam.
http://jsbin.com/vovuweyogu/1/edit Starting and stopping. CSS effects. Snapshot. https://dev.opera.com/articles/playing-with-html5-video-and-getusermedia/ http://html5-demos.appspot.com/static/getusermedia/photobooth.html http://neave.com/webcam/html5/ http://paint.gexsoft.com/