1
Follow code jQuery:
var el = $('#embed_video video').get(0);
var urlVideo = 'https://res.cloudinary.com/matheus/video/upload/ferrari.mp4';
urlVideo = urlVideo + '?t=' + new Date().getTime();
//urlVideo = https://res.cloudinary.com/matheus/video/upload/ferrari.mp4?t=197325475
el.pause();
el.src = urlVideo;
el.load();
el.play();
Follows HTML:
<div id="embed_video" class="embed-responsive">
<video class="embed-responsive-item" controls controlsList="nodownload">
<source src="" type="video/mp4">
Seu navegador não suporta vídeo em HTML5.
</video>
</div>
I use API’s Cloudinary. I upload a video on the server side with the same URL, but with different video. With the above code not working, I’m trying to do a "refresh" on the video element, but the old video remains the same.
When I press "F5" or refresh page, the video works as expected, it already changes the video loaded in the cloud (cloudinary).
Any idea how to reload a video using jQuery or Javascript?