resolve http 416 error while video streaming in asp.net core v3.1 in iis express

369 Views Asked by At

heres some background
i am building an asp.net core v3.1 app in visual studio
so im running this on IIS Express

im trying to get videos to stream on my page
based upon these posts:
https://odetocode.com/blogs/scott/archive/2018/01/09/streaming-content-in-asp-net-core.aspx
https://github.com/aspnet/Mvc/pull/6895

i have built this in the view

<video height="240" controls poster="">
     <source src="/Home/VidStream/667fb785-25fa-48ae-b7df-4e836ca60de2" type="video/mp4">
</video>

which corresponds to this function in the home controller

    [HttpGet]
    public async Task<IActionResult> VidStream(string id = "")
    {
        string fullpath = Path.Combine("z:/media/", vid.MediaName + ".mp4");
        return PhysicalFile(fullpath, "application/octet-stream", true);
    }

when the page builds i keep getting an err 416
so apparently err 416 has to do with ranges
but i enableRangeProcessing with that TRUE in the 3rd param
(also note that the media is not in webroot but residing elsewhere in a different media dir)

now - another stacker noted that he tried this code on his side and it worked
so that leaves me thinking its an IIS Express or VS issue??
or is it something else? anyone have ideas to resolve this?
also doesnt .net core v2.1 and above handle all the ranges and partial content?

0

There are 0 best solutions below