【问题标题】:VideoJS error ie9 mp4VideoJS错误ie9 mp4
【发布时间】:2013-04-02 19:52:17
【问题描述】:

我有一个提供 mp4 的 asp.net MVC 4 控制器,

public ActionResult GetVideoForEvent(int eventId)
    {
        var videoPath = "pathToVideo";
        var videoFileInfo = new FileInfo(videoPath);

        return new RangeFilePathResult("video/mp4", videoFileInfo.FullName, videoFileInfo.LastWriteTimeUtc, videoFileInfo.Length);
    }

以及部分视图中的视频播放器,

@model int
    <link href="https://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
    <script src="https://vjs.zencdn.net/c/video.js"></script>

    <video class="video-js vjs-default-skin" controls autoplay preload="none" width="320" height="256" data-setup="{}"  >
        <source type="video/mp4" src="@Url.Action("GetVideoForEvent", new { eventId = Model})">
    </video>

这适用于 ie8 和 ie10,但不适用于 ie9。 只有在使用 videojs 时才会出现问题,如果我只使用了 html5 &lt;video&gt; 视频播放。 此外,如果我将源更改为 iis 上文件的直接链接,视频就会播放。

ie9 控制台的输出:

LOG:  
LOG: Video Error[object Object]

使用videojs时出现错误的原因是什么,我该如何解决?

【问题讨论】:

    标签: asp.net asp.net-mvc-4 html5-video video.js


    【解决方案1】:

    我找到了解决方法。仅在浏览器为 ie 8 时使用 videojs,视频在 ie8、9、10 和 Google chrome 上播放。

    视频播放器在每个浏览器上看起来确实不同。

    <!--[if lt IE 9]>
        <link href="https://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
        <script src="https://vjs.zencdn.net/c/video.js"></script>
    <![endif]-->
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题。检查您的 mp4 文件的 MIME 类型是否正确,以及视频的编码是否正确。

      我发现this 网站上的调试指南很有帮助。

      【讨论】:

        猜你喜欢
        • 2012-02-11
        • 1970-01-01
        • 2012-08-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-06-24
        • 1970-01-01
        • 2015-10-27
        相关资源
        最近更新 更多