Hi ,
I have a controller action with returns a video stream data(MP4 format) to a video tag in cshtml view page.
But video is not playing. Some times it is playing in IE11, but not at all playing in in any other browser. By searching in google I got to know that stream data need to be encoded.
I don't understand what is to encode and how? I have tried searching but dint get any clear point on that.
I am saving the video file in database by converting it into byte array. While retrieving I am sending the byte array with file format in action result as a File. What else needs to be done here?
More over are there any C# dlls available which can do the encoding in C# instead of using external/ 3rd party applications?
this is my code.
controller action -
public ActionResult GetSearchResults(int id)
{
SearchService call = new SearchService();
var result = call.GetData(id);
return File(result.File , result.fileType);
}
html code -
<video id='videoobj' width='400' height='400' type='video/mp4' src='some server path /GetSearchResults/" + id + "'/>
Kindly guide me in right way how to achieve this video stream to play in all browsers which supports HTML5.
Thanks.