HTML Audio / Video DOM volume properties
HTML Audio / Video DOM Reference
Examples
The video volume set to 20%:
myVid=document.getElementById("video1");
myVid.volume=0.2;
myVid.volume=0.2;
try it"
Definition and Usage
volume property sets or returns the current volume of the audio / video.
Browser Support
All major browsers support volume attributes.
Note: 8 and earlier versions of Internet Explorer does not support this property.
grammar
Setting volume attributes:
audio|video .volume= volumevalue
Returns volume attributes:
audio|video .volume
Property Value
值 | 描述 |
---|---|
volumevalue | 规定音频/视频的当前音量。必须是介于 0.0 与 1.0 之间的数字。 例值:
|
technical details
返回值: | 数字值,指示当前的音量。 |
---|---|
默认值: | 1.0 |
HTML Audio / Video DOM Reference