diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/mediastream/active/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/mediastream/active/index.html')
-rw-r--r-- | files/ja/web/api/mediastream/active/index.html | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/files/ja/web/api/mediastream/active/index.html b/files/ja/web/api/mediastream/active/index.html new file mode 100644 index 0000000000..b6e058b07b --- /dev/null +++ b/files/ja/web/api/mediastream/active/index.html @@ -0,0 +1,105 @@ +--- +title: active +slug: Web/API/MediaStream/active +translation_of: Web/API/MediaStream/active +--- +<p>{{APIRef("Media Capture and Streams")}}</p> + +<p>{{domxref("MediaStream")}}インタフェースの<strong><code>active</code></strong>は読み取り専用のプロパティであり、ストリームが現在アクティブであれば<code>true</code>を返し、それ以外の場合は<code>false</code>を返します。少なくとも一つのトラックの状態が{{domxref("MediaStreamTrack.ended")}}でない場合、ストリームがアクティブであるとみなされます。すべでのトラックが終了すると、このストリームの<code>active</code>プロパティは<code>false</code>になります。</p> + +<h2 id="文法">文法</h2> + +<pre class="syntaxbox">var <em>isActive</em> = <em>MediaStream</em>.active;</pre> + +<h3 id="値">値</h3> + +<p>このストリームが現在アクティブな場合は<code>true</code>を返します。それ以外は<code>false</code>を返します。</p> + +<h2 id="例">例</h2> + +<p>この例では、{{domxref("MediaDevices.getUserMedia", "getUserMedia()")}}を用いて、要求されたユーザーのローカルのカメラとマイクロフォンをソースとする新しいストリームを取得しています。ストリームが有効になると(ここでは、{{jsxref("Promise")}}がfulfilledの状態になった時)、ストリームが現在アクティブであるかどうかに応じてページにあるボタンの状態が更新されます。</p> + +<pre class="brush: js">var promise = navigator.mediaDevices.getUserMedia({ + audio: true, + video: true +}); + +promise.then(function(stream) { + var startBtn = document.querySelector('#startBtn'); + startBtn.disabled = stream.active; +});</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状況</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('Media Capture', '#widl-MediaStream-active', 'active')}}</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>Microsoft Edge</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari (WebKit)</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoDesktop(52)}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</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>Firefox OS</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>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile(52)}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> |