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/zh-cn/web/api/htmlmediaelement/src | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/htmlmediaelement/src')
-rw-r--r-- | files/zh-cn/web/api/htmlmediaelement/src/index.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/htmlmediaelement/src/index.html b/files/zh-cn/web/api/htmlmediaelement/src/index.html new file mode 100644 index 0000000000..f02d765c3b --- /dev/null +++ b/files/zh-cn/web/api/htmlmediaelement/src/index.html @@ -0,0 +1,60 @@ +--- +title: HTMLMediaElement.src +slug: Web/API/HTMLMediaElement/src +translation_of: Web/API/HTMLMediaElement/src +--- +<div>{{APIRef("HTML DOM")}}</div> + +<div><strong><code>HTMLMediaElement.src</code></strong>属性反映HTML媒体元素的<code>src</code> 属性的值,该属性指示要在元素中使用的媒体资源的URL。</div> + +<div class="note"> +<p><strong>Note:</strong> 了解此元素中当前正在使用的媒体资源的URL的最佳方法是查看 {{domxref("HTMLMediaElement.currentSrc", "currentSrc")}}属性的值,该属性还考虑从 {{domxref("HTMLSourceElement")}} (代表 {{HTMLElement("source")}} 元素)中提供的列表中选择最佳或首选媒体资源</p> +</div> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="syntaxbox">var <em>mediaUrl</em> = <em>HTMLMediaElement</em>.src;</pre> + +<h3 id="Value">Value</h3> + +<p>一个{{domxref("USVString")}}对象,包含要在元素中使用的媒体资源的URL;此属性反映HTML元素的<code>src</code> 属性的值。</p> + +<h2 id="Example">Example</h2> + +<pre class="brush: js">var obj = document.createElement('video'); +console.log(obj.src); // "" +</pre> + +<h2 id="Specifications">Specifications</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('HTML WHATWG', "embedded-content.html#dom-media-src", "HTMLMediaElement.src")}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>No change from {{SpecName('HTML5 W3C')}}</td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', "embedded-content-0.html#dom-media-src", "HTMLMediaElement.src")}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.HTMLMediaElement.src")}}</p> + +<h2 id="See_Also" name="See_Also">See also</h2> + +<ul> + <li>The interface defining it, {{domxref("HTMLMediaElement")}}.</li> +</ul> |