The process cannot access the file 'video path' because it is being used by another process

Viewed 39

My project is about stream video in html page using tag video. this tag's src is a url like "http://localhost:35162/Uploads/video". that is a net core api service.

[HttpGet("vid")]
public IActionResult Get(string token)
{    
    var path = @"~/sample.mp4";            
    FileStream fileStream = new FileStream(path, FileMode.Open);
    return File(fileStream, "video/mp4");            
}

it works fine until the html page is open in one browser. when I open html page in another browser I face to this error:

The process cannot access the file 'video path' because it is being used by another process.

I want to be able show the video in multi browser at the same time. thanks

0 Answers
Related