JSFiddle - React, Tailwind, and code Playground
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>
JavaScript
$('video source').each(function(num,val){
console.log($(this).attr('src')); // i am not getting this..
strSrc = $(this).attr('src');
strPath = strSrc.substring(0, strSrc.lastIndexOf('/'));
strExtenion = strSrc.substring(strSrc.lastIndexOf('.'));
$(this).attr('src', strPath + "/" + "newFileName" + strExtenion );
alert($(this).attr('src'));
})