Video currentSrc property
Example
Get the URL of the current video:
var x = document.getElementById("myVideo").currentSrc;
xThe output result is similar to:
https://www.example.com/try/demo_source/mo-tt-11.mp4
Try it »
Definition and Usage
The currentSrc property returns the URL of the current video.
If the audio/video is not set, an empty string is returned.
Note: This attribute is read-only.
Tip: Usesrc The property sets the URL of the video file.
Browser support





All major browsers support the currentSrc attribute.
Note: Internet Explorer 8 and earlier IE versions do not support this attribute.
Syntax
videoObject
.currentSrc
Technical Details
| Return Value: | A string representing the current URL of the video, returning the actual URL including the protocol part (e.g. http://). If the video is not set, an empty string is returned. |
|---|
The Video object