English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML <video>-Element wird verwendet, um Medienabspieler in HTML- oder XHTML-Dokumenten einzubinden und unterstützt die Wiedergabe von Videos innerhalb des Dokuments. Sie können auch das <video>-Tag für Audiodaten verwenden, aber das <audio>-Element könnte für das Benutzererlebnis geeigneter sein.
Online-Beispiel
Beispiel !doctype html> <html> <head>-8" type="video <meta charset="UTF3<title>Verwendung des HTML-video-Tags (Grund教程网 w/codebox.com)< </title> head> <body> <video controls>4<source src="movie.mp/mp4" type="video ">/<source src="movie.webm" type="video <p>Ihr Browser unterstützt nicht die Datei <webm">39;t unterstützen HTML5 video. Hier ist a <a href="movie.mp4">link to the video</a> instead.</p> </video> </body> </html>Testen Sie und sehen Sie ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen dies.
Der <video>-Tag definiert ein Video, wie z.B. ein Filmabschnitt oder andere Videostreams.
Der <video>-Element unterstützt derzeit drei Videoformate: MP4、WebM、Ogg.
Browser | MP4 | WebM | Ogg |
---|---|---|---|
Internet Explorer | YES | NO | NO |
Chrome | YES | YES | YES |
Firefox | YES von Firefox 21 Version beginnt Linux-Systeme von Firefox 3ab Version 0 beginnt | YES | YES |
Safari | YES | NO | NO |
Opera | YES von Opera 25 Version beginnt | YES | YES |
MP4 = MPEG 4Dateien verwenden H264 Video-Decoder und AAC-Audio-Decoder
WebM = WebM-Dateien verwenden den VP8 Video- und Vorbis-Audio-Decoder
Ogg = Ogg-Dateien verwenden den Theora-Video- und Vorbis-Audio-Decoder
Format | MIME-type |
---|---|
MP4 | video/mp4 |
WebM | video/webm |
Ogg | video/ogg |
Der <video>-Tag ist ein HTML5 neue Tags.
Hinweis:Man kann <video> und </Der Text wird zwischen den Tags <video> platziert, sodass Browser, die den <video>-Tag nicht unterstützen, die Informationen desselben anzeigen können.
New: HTML5 New attributes added in
Attribute | Value | Description |
---|---|---|
autoplayHTML5 | autoplay | If this attribute is present, the video is played immediately after it is ready. |
controlsHTML5 | controls | If this attribute is present, controls such as the play button are displayed to the user. |
heightHTML5 | pixels | Set the height of the video player. |
loopHTML5 | loop | If this attribute is present, the media file will start playing again after it is finished. |
mutedHTML5 | muted | If this attribute is present, the audio output of the video is muted. |
posterHTML5 | URL | Specify the image to be displayed while the video is downloading, until the user clicks the play button. |
preloadHTML5 | auto metadata none | If this attribute is present, the video is loaded and prepared for playback when the page is loaded. If "autoplay" is used, this attribute is ignored. |
srcHTML5 | URL | URL of the video to be played. |
widthHTML5 | pixels | Set the width of the video player. |
Support for <video> Tag Global Attributes of HTML.
Support for <video> Tag HTML Event Attributes.