c# - Play Videos in ASP.NET MVC using Custom Action Filter -
i want video using custom action filter below code find working not able pass strvideofilepath variable.this videocustomdataresult.cs code
public override void executeresult(controllercontext context) { var strvideofilepath = hostingenvironment.mappath("~/videofiles/test2.mp4"); context.httpcontext.response.addheader("content-disposition", "attachment; filename=test2.mp4"); var objfile = new fileinfo(strvideofilepath); var stream = objfile.openread(); var objbytes = new byte[stream.length]; stream.read(objbytes, 0, (int)objfile.length); context.httpcontext.response.binarywrite(objbytes); }
here calling as
public actionresult index() { return new videodataresult(fileurl); }
can tell me how pass video source variable razor view.
Comments
Post a Comment