Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Video currentSrc Property

Video currentSrc property

Video Object Reference The Video object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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.

Video Object Reference The Video object