diff options
Diffstat (limited to 'files/zh-cn/web/api/mediastream/id/index.html')
-rw-r--r-- | files/zh-cn/web/api/mediastream/id/index.html | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/mediastream/id/index.html b/files/zh-cn/web/api/mediastream/id/index.html new file mode 100644 index 0000000000..ef5d47c56c --- /dev/null +++ b/files/zh-cn/web/api/mediastream/id/index.html @@ -0,0 +1,99 @@ +--- +title: MediaStream.id +slug: Web/API/MediaStream/id +translation_of: Web/API/MediaStream/id +--- +<p>{{APIRef("WebRTC")}}</p> + +<p><code><strong>MediaStream.id</strong></code> 只读属性,一个包含36个字符的 {{domxref("DOMString")}} ,用来作为这个对象的唯一标识符 (GUID) 。</p> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<pre class="syntaxbox">var <em>id</em> = <em>mediaStream</em>.id; +</pre> + +<h2 id="示例">示例</h2> + +<pre class="brush: js"><code class="language-html">var p = navigator.mediaDevices.getUserMedia({ audio: true, video: true }); + +p.then(function(stream) { + console.log(stream.id); +};) +</code></pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Media Capture', '#widl-MediaStream-id', 'MediaStream.id')}}</td> + <td>{{Spec2('Media Capture')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Edge</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{ CompatGeckoDesktop(41) }}</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>Edge</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatUnknown() }}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{ CompatGeckoMobile(41) }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + <td>{{ CompatUnknown() }}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{domxref("MediaStream")}},包含该属性的接口。</li> +</ul> |