HTML Audio/Video DOMcurrentSrcProperty

HTML Audio/Video DOM Reference Manual

Example

Get the current video's URL:

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

Try it Yourself »

Definition and Usage

The currentSrc property returns the URL of the current audio/video.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the currentSrc property.

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


Syntax

audio|video.currentSrc

Technical Details

Return value: A string value representing the current URL of the audio/video.


HTML Audio/Video DOM Reference Manualother extensions