WMV流媒体文件大小限制

Dea*_*Pue 12 c# wmv video-streaming asp.net-mvc-4

我的网页视图中嵌入了一个Windows Media Player:

 <div id="divCourseVideo" style="width:100%;margin:0 auto;" class="container">
        <OBJECT style="display:inline-block" ID="CoursePlayer" HEIGHT="400" WIDTH="400" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="video/x-ms-wmv">
            <param name='URL' value="@Url.Action("ShowMovie", "OLT", new { courseId = Model.ID })" />
            <param name='autoStart' value="true" />
            <param name='currentPosition' value="false" />
            <param name='showControls' value="true" />
        </OBJECT>


    </div>
Run Code Online (Sandbox Code Playgroud)

ShowMovie操作从数据库中提取视频流,并将其发送到视图,其中包含:

 public void ShowMovie(string courseId)
    {
        CourseVideo video = Repository.GetCourseVideoStream(courseId);
        var bytesinfile = new byte[video.VideoStream.Length];
        video.VideoStream.Read(bytesinfile, 0, (int)video.VideoStream.Length);
        ControllerContext.HttpContext.Response.BinaryWrite(bytesinfile);
    }
Run Code Online (Sandbox Code Playgroud)

当我使用大约10K左右的视频时,播放效果会很好.但是,如果我使用大约137​​K左右的文件,文件永远不会播放.它太大了吗?

当我使用F12查看网络活动时,我看到该文件正试图以text/html的形式出现.这是为什么?我也在GET函数中看到它正在中止.这是为什么?我增加了executionTimeout值无济于事.

在此输入图像描述

来自napuza的信息非常好我能够获得正确的内容类型,似乎整个文件都流式传输到浏览器但它从未播放过.

在此输入图像描述

nap*_*zba 6

指定ContentType:

ControllerContext.HttpContext.Response.ContentType = "video/x-ms-wmv";
ControllerContext.HttpContext.Response.BinaryWrite(bytesinfile);
Run Code Online (Sandbox Code Playgroud)