blob: 4c14481223d97249cf18a2d0cceafe9756b67601 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
---
title: MediaTrackSupportedConstraints.frameRate
slug: Web/API/MediaTrackSupportedConstraints/frameRate
translation_of: Web/API/MediaTrackSupportedConstraints/frameRate
---
<div>{{APIRef("Media Capture and Streams")}}</div>
<div> </div>
<p><a href="https://developer.mozilla.org/ja/docs/Web/API/MediaTrackSupportedConstraints" title="MediaTrackSupportedConstraintsディクショナリは、MediaStreamTrackオブジェクトを実装しているuser agentやブラウザによって理解できる制約可能なプロパティの一覧を表します。MediaDevices.getSupportedConstraints()によって、MediaTrackSupportedConstraintsに適合するオブジェクトが戻り値として返されます。"><code>MediaTrackSupportedConstraints</code></a>ディクショナリーの<strong><code>frameRate</code></strong>プロパティは読み取り専用のBooleanの値です。<a href="https://developer.mozilla.org/ja/docs/Glossary/user_agent" rel="nofollow" title="この用語 (user agent) の定義はまだ書かれていません。ぜひご寄稿ください!">user agent</a>が<strong><code>frameRate</code></strong>の制約をサポートしている場合、<a href="https://developer.mozilla.org/ja/docs/Web/API/MediaDevices/getSupportedConstraints" title="MediaDevices インタフェースのgetSupportedConstraints() メソッドは、MediaTrackSupportedConstraintsディクショナリをベースとするオブジェクトを戻り値として返します。このオブジェクトのメンバーフィールドは、user agentが扱えるメディア制約に関するプロパティを表しています。"><code>MediaDevices.getSupportedConstraints()</code></a>の戻り値のオブジェクトに含まれ<code>true</code>が設定されます。この制約がサポートされない場合は含まれないため、<code>false</code>になることはありません。</p>
<p><code>frameRate</code>制約は、新しいビデオトラックのフレームレートの許容できる上限と下限、あるいは正確なフレームレートを表すのに用いられます。このプロパティの値を確認することで、フレームレートでのビデオトラック設定の制約をユーザーエージェントが対応しているかを特定することができます。どのように使われるかは{{anch("Example", "example")}}を見てください。</p>
<h2 id="文法">文法</h2>
<pre class="syntaxbox"><em>frameRateConstraintSupported</em> = <em>supportedConstraintsDictionary</em>["frameRate"];</pre>
<h3 id="値">値</h3>
<p>ユーザーエージェントが<code>frameRate</code>の制約をサポートする場合、このプロパティはディクショナリーに存在します。このプロパティが存在しない場合は、ユーザーエージェントは、ビデオトラックのフレームレートを制限することができません。</p>
<div class="note">
<p>このプロパティが存在する場合は、常に<code>true</code>になります。</p>
</div>
<h2 id="Example" name="Example">例</h2>
<p>この簡単な例では、ビデオの要求時でのフレームレートの制約をブラウザがサポートしているかどうかを確認するものです。</p>
<h3 id="JavaScript">JavaScript</h3>
<pre class="brush: js">let result = document.getElementById("result");
if (navigator.mediaDevices.getSupportedConstraints()["frameRate"]) {
result.innerHTML = "Supported!";
} else {
result.innerHTML = "Not supported!";
}</pre>
<details open><summary>
<h3 id="HTML">HTML</h3>
</summary>
<pre class="brush: html"><div id="result">
</div></pre>
</details>
<details open><summary>
<h3 id="CSS">CSS</h3>
</summary>
<pre class="brush: css">#result {
font: 14px "Arial", sans-serif;
}</pre>
</details>
<h3 id="結果">結果</h3>
<p>利用中のブラウザが<code>frameRate</code>の制約をサポートしているかどうかは次の通りです。</p>
<p>{{ EmbedLiveSample('Example', 600, 80) }}</p>
<p>この例はとても簡単なので、"Supported"と"Not supported"の単純な出力を、視聴覚情報を表現するための別の方法に置き換えることができます。</p>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様</th>
<th scope="col">状況</th>
<th scope="col">コメント</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('Media Capture', '#widl-MediaTrackSupportedConstraints-frameRate', 'frameRate') }}</td>
<td>{{ Spec2('Media Capture') }}</td>
<td>初版</td>
</tr>
</tbody>
</table>
<h2 id="ブラウザ互換性">ブラウザ互換性</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{ CompatGeckoDesktop(50) }}</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Android Webview</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
<th>Chrome for Android</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{ CompatGeckoMobile(50) }}</td>
<td>{{CompatNo}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="関連項目">関連項目</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams API</a></li>
<li>{{domxref("MediaDevices.getSupportedConstraints()")}}</li>
<li>{{domxref("MediaTrackSupportedConstraints")}}</li>
<li>{{domxref("MediaStreamTrack")}}</li>
</ul>
|