để hiển thị video trong html 5 bạn dùng thẻ video
<video src="movie.ogg" controls="controls">
</video>
controls="controls" với "controls" có thể là play, pause, and volume controls.
vài thuộc tính video trong html5
autoplay | autoplay | Specifies that the video will start playing as soon as it is ready |
controls | controls | Specifies that controls will be displayed, such as a play button. |
height | pixels | Specifies the height of the video player |
loop | loop | Specifies that the media file will start over again, every time it is finished. |
preload | preload | Specifies that the video will be loaded at page load, and ready to run. Ignored if "autoplay" is present. |
src | url | Specifies that the URL of the video to play |
width | pixels |
ví dụ
<video width="320" height="240" controls="controls">
<source src="movie.ogg" type="video/ogg" />
<source src="movie.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
No comments: