Jquery - how i can get the video src value?
- by 3gwebtrain
i need to get the value of a video and need to change in to new value... for that i used this function:
var video = $('#task2ResultVideo').get(0);
console.log($(video).attr('poster')); // i am getting this
$(video).attr('src',function(num,val){
console.log(num,val) // i am not getting this..
}) ?
HTML:
<video id="task2ResultVideo" autobuffer poster="img/task2-results-host-poster.jpg">
<source src="Video/webm/Task_2.4a_Host_treated.webm" type="video/webm" />
<source src="Video/ogv/Task_2.4a_Host_treated.theora.ogv" type="video/ogg" />
<source src="Video/MP4/Task_2.4a_Host_treated.mp4" type="video/mp4" />
</video>?
But i am not able to get the values. what is wrong with my code? in case if i get the value how can i change the src?
any suggestion please?