Html-video-tag
提供:Dev Guides
HTML-<video>タグ
説明
HTML <video>タグは、ビデオをWebページに埋め込むために使用され、いくつかのビデオソースがあります。
例
<!DOCTYPE html>
<html>
<head>
<title>HTML video Tag</title>
</head>
<body>
<p>Run your first program using an Online Compiler (compileonline.com)</p>
<br/>
<video width = "500" height = "300" controls>
<source src = "/html/compileonline.mp4" type = "video/mp4">
This browser doesn't support video tag.
</video>
</body>
</html>
これは、次の結果を生成します-
グローバル属性
このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします
特定の属性
HTML <video>タグは、次の追加属性もサポートしています-
Attribute | Value | Description |
---|---|---|
autoplay html-5 | autoplay | Specifies that the video will play automatically. |
controls html-5 | controls | Specifies that the video controls gets displayed. |
height html-5 | pixels | Specifies the height |
loop html-5 | loop | Specifies that the video will start again every time after finish. |
muted html-5 | muted | Specifies that the audio should be muted |
poster html-5 | URL | Specifies the image to be shown while the video is downloading. |
preload html-5 | auto metadata none | Specifies what author thinks will lead to user experience at its best. |
src html-5 | URL | Specifies the URL |
width html-5 | pixels | Specifies the width |
イベント属性
このタグは、− link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートします。
ブラウザのサポート
Chrome | Firefox | IE | Opera | Safari | Mobile |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |