Latest web development tutorials

HTML Audio / Video DOM currentSrc property

HTML audio / video Tag Reference HTML Audio / Video DOM Reference

Examples

Get the current URL of the video:

myVid=document.getElementById("video1");
alert(myVid.currentSrc);

try it"

Definition and Usage

currentSrc property returns the current URL of audio / video.

If no audio / video, an empty string is returned.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support currentSrc property.

Note: 8 and earlier versions of Internet Explorer does not support this property.


grammar

audio|video .currentSrc

technical details

返回值: 字符串值,表示音频/视频的当前 URL。


HTML audio / video Tag Reference HTML Audio / Video DOM Reference