视频标签在 IE 9 中不起作用 [英] Video tag not working in IE 9

查看:32
本文介绍了视频标签在 IE 9 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建的视频标签在 IE9 中不起作用.它在 Firefox 和 Chrome 中运行正常.

The video tag I'm building will not work in IE9. Its works ok in Firefox and Chrome.

我将 mime 添加到 IIS 7.5 服务器 Extension=.mp4 Mime Type=video/mp4

I added the mime to the IIS 7.5 server Extension=.mp4 Mime Type=video/mp4

我使用此代码使用 jQuery 创建元素

I create the elements with jQuery using this code

function fsuccLoadVideo(data) {
    var arr = GetNormalizeMetadataClean(data);
    var vid = $('<video width=400 height=300 controls poster=' + arr[0]["CntrTestVideoImage"] + '/>');
    var loc = window.location.href;
    var idx = loc.lastIndexOf('/') + 1;
    var mp4loc = loc.substr(0, idx)+ arr[0]["CntrTestVideoMp4Src"];
    loc =  loc.substr(0, idx)+ arr[0]["CntrTestVideoOggSrc"];
    if ((arr[0]["CntrTestVideoMp4Src"] != undefined) && (arr[0]["CntrTestVideoMp4Src"].length > 0)) {
        $("<source />", { src: loc, type: 'video/webm; codecs="vp8, vorbis"' }).appendTo(vid);
        $("<source />", { src: mp4loc, type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' }).appendTo(vid);
        $("<source />", { src: loc, type: 'video/ogg; codecs="theora, vorbis"' }).appendTo(vid);

        $(vid).append("Your browser does not support the video tag");
        $("#videosection").append(vid);
    }

}

它以这种方式在浏览器上呈现:

and it renders on the browser this way:

<source 
  src="http://10.1.16.102:90/Intranet/safety/contractortest/video/cntrTest1.ogg" 
  type="video/webm; codecs="vp8, vorbis"">

(无法正确格式化以显示完整渲染,但这里是关键行

(can't get formatting correct to show full rendering, but here is the critical line

推荐答案

ie9 仅在您将其安装为 3rd 方应用程序时才支持 webm.

ie9 only supports webm if you install it as 3rd party app.

这篇关于视频标签在 IE 9 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆