HTML Audio/Video DOM currentSrc Property

Example

Get the current URL of the video:

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

Try It Yourself

Definition and Usage

currentSrc returns the current URL of the audio/video if familiar.

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

Browser Support

All major browsers support the currentSrc property.

Note:Internet Explorer 8 or earlier browsers do not support this property.

Syntax

audio|video.currentSrc

Technical Details

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