它如何生成一个动作结果ASP.MVC
public ActionResult LoadVideo(){
string file="http://another-server.com/123.mp4";// file is URL Video
// how to response a video partial for view in <Video></Video> HTML
}
我要用HTML查看结果
<video width="400" controls>
<source src="/Controller/LoadVideo" type="video/mp4">
Your browser does not support HTML5 video.
</video>
我尚未测试您的代码,但我希望它能像这样更好地工作:
public ActionResult LoadVideo()
{
return Content("http://another-server.com/123.mp4"); //send URL of Video to caller
}
然后您的HTML也会像这样:(其中src
调用LoadVideo
函数并使用returned响应)。
<source src="@Url.Content("LoadVideo")" type="video/mp4" />