Video currentSrc Attribute

Definition and Usage

currentSrc This attribute returns the current video URL.

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

Note:This attribute is read-only.

Tip:Please use src attribute Set the URL of the video file.

Example

Get the current video URL:

var x = document.getElementById("myVideo").currentSrc;

Try It Yourself

Syntax

videoObject.currentSrc

Technical Details

Return Value:

String value representing the current video URL.

Returns the entire URL, including the protocol (such as http://).

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

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 9.0 Support Support Support