Introduction to HTML programming
HTML5 - Audio & Video
HTML 5 features, include native audio and video support without the need for Flash.
HTML5 supports <audio> tag which is used to embed sound content in an HTML or XHTML document.
<audio src="xyz.ogg" controls autoplay> Your browser does not support the <audio> element. </audio>
most commonly used audio formats are ogg, mp3 and wav.
<!DOCTYPE HTML> <html> <body> <audio controls autoplay> <source src="abc.mp3" type="audio/ogg" /> Your browser does not support the audio element. </audio> </body> </html>
<video src="foo.mp4" width="300" height="200" controls> Your browser does not support the <video> element. </video>
most commonly used video formats are −
- Ogg − Ogg files with Thedora video codec and Vorbis audio codec.
- mpeg4 − MPEG4 files with H.264 video codec and AAC audio codec.
Video Attribute Specification
The HTML5 video tag can have a number of attributes to control the look and feel and various functionalities of the control −
|autoplay||This boolean attribute if specified, the video will automatically begin to play back as soon as it can do so without stopping to finish loading the data.|
|autobuffer||This boolean attribute if specified, the video will automatically begin buffering even if it’s not set to automatically play.|
|controls||If this attribute is present, it will allow the user to control video playback, including volume, seeking, and pause/resume playback.|
|height||This attribute specifies the height of the video’s display area, in CSS pixels.|
|loop||This boolean attribute if specified, will allow video automatically seek back to the start after reaching at the end.|
|preload||This attribute specifies that the video will be loaded at page load, and ready to run. Ignored if autoplay is present.|
|poster||This is a URL of an image to show until the user plays or seeks.|
|src||The URL of the video to embed. This is optional; you may instead use the <source> element within the video block to specify the video to embed|
|width||This attribute specifies the width of the video’s display area, in CSS pixels.|
Introduction to html programming lessons. You will learn how to create a website using html code.you will also learn how to create basic html programs.
- Lectures 30
- Quizzes 0
- Duration 50 hours
- Skill level All levels
- Language English
- Students 1
- Certificate No
- Assessments Self