I\'m in the process of working out what the best way is going to be to do the following:
I have a bunch of CCTV footage files (MP4 files, ranging from 4MB-50MB in size),
Place the static video files on a web server and reference them in a video player. You can use HTML's standard player (<video src="http://location/of/file.mp4">) or go for something fancier - just google for "html video player".
To make sure that the video files don't have to download completely before starting to play just run them beforehand through qt-faststart.
Two things:
Use a video element in your HTML (this works in browsers AND iOS):
<video src="http://yoursite.com/api/Media/GetVideo?videoId=42" />
Support 206 PARTIAL CONTENT
requests in you Web API code. This is crucial for both streaming and iOS support, and is mentioned in that thread you posted.
Just follow this example:
https://devblogs.microsoft.com/aspnet/asp-net-web-api-and-http-byte-range-support/
In a nutshell:
if (Request.Headers.Range != null)
{
// Return part of the video
HttpResponseMessage partialResponse = Request.CreateResponse(HttpStatusCode.PartialContent);
partialResponse.Content = new ByteRangeStreamContent(stream, Request.Headers.Range, mediaType);
return partialResponse;
}
else
{
// Return complete video
HttpResponseMessage fullResponse = Request.CreateResponse(HttpStatusCode.OK);
fullResponse.Content = new StreamContent(stream);
fullResponse.Content.Headers.ContentType = mediaType;
return fullResponse;
}