I am trying to get video URL using JavaScript. Code is ...
<div class="flideo">
<video x-webkit-airplay="allow" preload="" src="http://pdl.vimeocdn.com/80388/120/224743790.mp4?token2=1394169786_c1f036dda110a70d45fd824ec6692b94&aksessionid=e766a96a167c751e" poster=""></video>
</div>
Thanks..
Attribute Values The URL of the video file. Possible values: An absolute URL - points to another web site (like src="http://www.example.com/movie.ogg") A relative URL - points to a file within a web site (like src="movie.
The <video> tag contains one or more <source> tags with different video sources. The browser will choose the first source it supports. The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.
To change source on HTML5 video tag with JavaScript, we an set the src property of the video element. const changeSource = (url) => { const video = document. getElementById("video"); video. src = url; video.
The accepted answer didn't work for me, I had to change src
to currentSrc
, i.e.:
var videoTags = document.getElementsByTagName('video')
for( var i = 0; i < videoTags.length; i++ ){
alert( videoTags.item(i).currentSrc )
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With