FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

Video currentSrc Property

Video Object Reference Video Object

Example

Get the URL of the current video:

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

The result of x will be:

http://tutorials/jsref/movie.mp4
Try it Yourself »

Definition and Usage

The currentSrc property returns the URL of the current video.

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

Note: This property is read-only.

Tip: Use the src property to set the URL of a video file.


Browser Support

Property
currentSrc Yes 9.0 Yes Yes Yes

Syntax

videoObject.currentSrc

Technical Details

Return Value: A String, representing the URL of the current video. Returns the entire URL, including the protocol (like http://). If no video is set, an empty string is returned

Video Object Reference Video Object