HTML 5 facilitates a standard video element to show video in web page. As of now following video formates are supported.
- Ogg = Ogg files with Theora video codec and Vorbis audio codec
- MPEG4 = MPEG 4 files with H.264 video codec and AAC audio codec
- WebM = WebM files with VP8 video codec and Vorbis audio codec
Element:
<video> </video>
Attributes:
- src - url of the video
- height - height of the player in pixels
- width - width of the player in pixels
- controls - if present player controls will be shown
- autoplay - if present video will be started as soon as it is ready to play. Default is manual.
- loop - if present video will be played from beginning when it finishes playing
- poster - to show a placeholder image for player
- preload - load the complete video at page load. This attribute is ignored if autoplay is present.
- audio - to mute the audio
Example:
<video width="320" height="240" controls="controls" autoplay>
<source src="movie.ogg" type="video/ogg" />
<source src="movie.mp4" type="video/mp4" />
<source src="movie.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
<source src="movie.ogg" type="video/ogg" />
<source src="movie.mp4" type="video/mp4" />
<source src="movie.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
0 comments:
Post a Comment