Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# HTML5播放器视频赢得';部署时不显示流_C#_Html_Asp.net Mvc 4 - Fatal编程技术网

C# HTML5播放器视频赢得';部署时不显示流

C# HTML5播放器视频赢得';部署时不显示流,c#,html,asp.net-mvc-4,C#,Html,Asp.net Mvc 4,以下代码在本地IIS上正常工作,但当部署的视频不再流化时(它们被下载并播放)。看起来是服务器配置或项目配置问题。有人能帮我或给我一个线索吗 try { ScreenDefinition sd = handler.Get(); Response.Clear(); Response.ClearHeaders(); Response.ClearCont

以下代码在本地IIS上正常工作,但当部署的视频不再流化时(它们被下载并播放)。看起来是服务器配置或项目配置问题。有人能帮我或给我一个线索吗

try
            {
                ScreenDefinition sd = handler.Get();
                Response.Clear();
                Response.ClearHeaders();
                Response.ClearContent();
                if (Format == "Ogg")
                {
                    Response.ContentType = "video/ogg";
                    Response.AddHeader("Content-Length", sd.Ogg.Length.ToString());
                    Response.AddHeader("Content-Disposition", "attachment; filename=video.ogg");
                    Response.OutputStream.Write(sd.Ogg.ToArray(), 0, sd.Ogg.Length);
                }
                else {
                    Response.ContentType = "video/mp4";
                    Response.AddHeader("Content-Length", sd.WhatCanKADoScreenMp4.Length.ToString());
                    Response.AddHeader("Content-Disposition", "attachment; filename=video.mp4");
                    Response.OutputStream.Write(sd.Mp4.ToArray(), 0, sd.Mp4.Length);
                }
                Response.End();
            }
            catch
            {
                //videos streaming was canceled by user
                //log it
            }
视图中的代码:

<video width="400" height="300" controls="controls" autoplay="autoplay" style="margin-left: 270px; margin-bottom: 5px;">
        <source src="@Url.Action("GetVideoStream", new { Format = "Mp4" })" type="video/mp4">
        <source src="@Url.Action("GetVideoStream", new { Format = "Ogg" })" type="video/ogg">
    Your browser does not support the video tag.
    </video>

您的浏览器不支持视频标记。

我认为您希望做的是在服务器上实现渐进式下载。我对你的配置一无所知,但是谷歌搜索会得到很好的结果


更多信息:

谢谢您的快速回复。我会努力研究的。泰