3
In my view, I have an old video, when I "upload" new video, want to automatically reload a new video after "upload".
Follows the code View:
<div id="embed_video" class="embed-responsive embed-responsive-16by9">
<video class="embed-responsive-item" controls>
<source src="/Files/GetVideo?id=2" type="video/mp4">
Seu navegador não suporta vídeo em HTML5.
</video>
</div>
Follows code Javascript:
$('#embed_video video').get(0).load();
Javascript code only works the first time, the second time the video does not update, is as old.
Follows code Controller:
public ActionResult GetVideo(int id)
{
using (var ctx = new Entities())
{
var result = ctx
.Video
.FirstOrDefault();
byte[] video_byte = result.Video;
return new RangeFileContentResult(video_byte, "video/mp4", "NomeDoArquivo.mp4", date);
}
}
Some solution ?
From now on, thank you.
Dear Matheus, I had wrong variables in the script, I also added another check, now I think the code is 100%, if I can update to the name is better.
– Guilherme Nascimento
@Guilhermenascimento Yes I saw that, I didn’t warn you.
– Matheus Miranda