aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html')
-rw-r--r--files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html b/files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html
new file mode 100644
index 0000000000..4c25adaa56
--- /dev/null
+++ b/files/zh-cn/web/api/htmlmediaelement/currentsrc/index.html
@@ -0,0 +1,56 @@
+---
+title: HTMLMediaElement.currentSrc
+slug: Web/API/HTMLMediaElement/currentSrc
+translation_of: Web/API/HTMLMediaElement/currentSrc
+---
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p><strong><code>HTMLMediaElement.currentSrc</code></strong> 属性包含所选媒体源的绝对URL路径。例如当程序会根据用户显示器分辨率选择不同媒体文件时会用到这个属性,显然它是只读的。当<code><strong>networkState</strong></code>值为<code><strong>EMPTY</strong></code>时,本属性值为空字符串(empty string).</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox">var <em>mediaUrl</em> = <em>audioObject</em>.currentSrc;</pre>
+
+<h3 id="值">值</h3>
+
+<p>一个 {{domxref("DOMString")}} 对象包含所选媒体源的绝对URL路径。当 <code>networkState</code> == <code>EMPTY时,其值为空字符串(empty string)</code>; 否则,它会是 {{domxref("HTMLSourceElement")}} 所包含媒体列表中的一个,或者是 {{HTMLElement("source")}} 标签的src 值.</p>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">var obj = document.createElement('video');
+console.log(obj.currentSrc); // ""
+</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('HTML WHATWG', "#dom-media-currentsrc", "HTMLMediaElement.currentSrc")}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>No change from {{SpecName('HTML5 W3C')}}</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.currentSrc")}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.HTMLMediaElement.currentSrc")}}</p>
+
+<h2 id="See_Also" name="See_Also">参考</h2>
+
+<ul>
+ <li>The interface defining it, {{domxref("HTMLMediaElement")}}.</li>
+</ul>