HTMLMediaElement.src

这篇翻译不完整。请帮忙从英语翻译这篇文章

HTMLMediaElement.src属性反映HTML媒体元素的src 属性的值,该属性指示要在元素中使用的媒体资源的URL。

Note: 了解此元素中当前正在使用的媒体资源的URL的最佳方法是查看 currentSrc属性的值,该属性还考虑从 HTMLSourceElement (代表 <source> 元素)中提供的列表中选择最佳或首选媒体资源

Syntax

var mediaUrl = HTMLMediaElement.src;

Value

一个USVString对象,包含要在元素中使用的媒体资源的URL;此属性反映HTML元素的src 属性的值。

Example

var obj = document.createElement('video');
console.log(obj.src); // ""

Specifications

Specification Status Comment
HTML Living Standard
HTMLMediaElement.src
Living Standard No change from HTML5
HTML5
HTMLMediaElement.src
Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 3.5IE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

文档标签和贡献者

此页面的贡献者: Torlinone
最后编辑者: Torlinone,