English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
volume stellt die Lautstärke des abzuspielenden Mediums ein.
HTML Audio/Video DOM Reference Manual
Video-Lautstärke auf 30%:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Verwendung der video volume Eigenschaft-Grundtutorials(oldtoolbag.com)</title> </head> <body> <p> <button onclick="getVolume()" type="button">Lautstärke?/button> <button onclick="setHalfVolume()" type="button">Video-Lautstärke auf 20%</button> <button onclick="setFullVolume()" type="button">Video-Lautstärke auf 10%</button> </p> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Ihre Browser unterstützt keine HTML5 video Tag. </video> <script> 1 function getVolume() {} alert(myVid.volume); } function setHalfVolume() {} myVid.volume=0.3; } function setFullVolume() {} myVid.volume=0.1; } </script> </body> </html>Test and see ‹/›
volume volume property sets or returns audio/The current volume of the video.
IEFirefoxOperaChromeSafari
All major browsers support the volume attribute.
Note:Internet Explorer 8 and earlier versions do not support this attribute.
Set volume attribute:
audio|video.volume=volumevalue
Return volume attribute:
audio|video.volume
Value | Description |
---|---|
volumevalue | Specify audio/The current volume of the video. It must be between 0.0 and 1Numeric value between .0 Example value:
|
Return value: | Numeric value indicating the current volume. |
---|---|
Default value: | 1.0 |