English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML <source> -Element gibt mehrere Mediendateien für das <picture>, <audio> oder <video> -Element an. Dies ist ein leeres Element. Es wird normalerweise verwendet, um dasselbe Mediengut in verschiedenen von Browsern unterstützten Formaten bereitzustellen.
Ein Video-Player mit drei Quelldateien. Der Browser muss die Quelldatei auswählen, die er unterstützt (wenn alle unterstützt werden, kann eine beliebige gewählt werden):
!doctype html <html> <head> <meta charset="UTF-8"> <title HTML Source-Tag-Benutzung (Grundlagen-Tutorial-Netz)3codebox.com)</title> </head> <body> <video controls> <source src="movie.webm" type="video/webm"> <source src="movie.ogg" type="video/ogg"> <source src="movie.mov" type="video/quicktime"> I39;m Entschuldigung; Ihr Browser unterstützt nicht39;t support HTML5 video. </video> </body> </html>Testen Sie, ob ‹/›
IEFirefoxOperChromeSafari
IE 9+Firefox, Opera, Chrome and Safari all support the <source> tag.
Note:IE 8 or earlier versions of IE browsers do not support the <source> tag.
<source> Tag defines and describes media resources for media elements (such as <video> and <audio>).
<source> Tag allows you to specify two videos/Audio files let the browser choose the media type or codec based on its support.
<source> Tag is an HTML5 new tag in
New: HTML5 new attribute in
Attribute | Value | Description |
---|---|---|
mediaHTML5 | media_query | Specify the type of the media resource, for the browser to decide whether to download. |
srcHTML5 | URL | Specify the URL of the media file. |
typeHTML5 | MIME_type | Specify the MIME type of the media resource. |
Support for <source> Tag Global Attributes of HTML.
Support for <source> Tag HTML Event Attributes.