Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 -
C#
public ActionResult GetSearchResults(int id)
       {
           SearchService call = new SearchService();
            var result = call.GetData(id);
           return File(result.File , result.fileType);
       }

html code -
HTML
<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.
Posted
Updated 16-Oct-15 2:55am
v4

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900