HTMLMediaElement: volume プロパティ
HTMLMediaElement.volume
プロパティは、メディアを再生する音量を設定します。
値
double
値で 0 から 1 の間でなければなりません。 ここで、0 は効果的にミュートされ、1 が最大の可能な値です。
例
js
const obj = document.createElement("audio");
console.log(obj.volume); // 1
obj.volume = 0.75;
仕様書
Specification |
---|
HTML # dom-media-volume-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
volume |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
HTMLMediaElement
:HTMLMediaElement.volume
プロパティを定義しているインターフェイスHTMLMediaElement.muted