From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/htmlmediaelement/volume/index.html | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 files/zh-cn/web/api/htmlmediaelement/volume/index.html (limited to 'files/zh-cn/web/api/htmlmediaelement/volume') diff --git a/files/zh-cn/web/api/htmlmediaelement/volume/index.html b/files/zh-cn/web/api/htmlmediaelement/volume/index.html new file mode 100644 index 0000000000..0c762ebc4b --- /dev/null +++ b/files/zh-cn/web/api/htmlmediaelement/volume/index.html @@ -0,0 +1,57 @@ +--- +title: HTMLMediaElement.volume +slug: Web/API/HTMLMediaElement/volume +translation_of: Web/API/HTMLMediaElement/volume +--- +

{{APIRef("HTML DOM")}}

+ +

HTMLMediaElement.volume 属性可设置媒体播放时的音量。

+ +

语法

+ +
var volume ​= video.volume; //1
+ +

+ +

取值为 0 到 1 的双精度值。0 为静音,1 为音量最大时的值。

+ +

示例

+ +
var obj = document.createElement('audio');
+console.log(obj.volume); // 1
+obj.volume = 0.75;
+ +

规范

+ + + + + + + + + + + + + + + + + + + +
规范状态备注
{{SpecName('HTML WHATWG', "#dom-media-volume", "HTMLMediaElement.volume")}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.volume")}}{{Spec2('HTML5 W3C')}}
+ +

浏览器兼容性

+ + + +

{{Compat("api.HTMLMediaElement.volume")}}

+ +

更多

+ + -- cgit v1.2.3-54-g00ecf