Internet Explorer 8 中的 HTML5 视频

标签 html video html5-video

我知道 <video>标记在 Internet Explorer 8 中不能正常工作,但这没关系。我想要做的是,如果用户尝试使用 IE8 打开链接,显示一条错误消息,类似 you're using browser XX and it's not supported .

我试过这个:

<video id="ivideo" src="skins/Sandbox_Light/styleVideos/anima.mp4" controls onended="ivideo();" style="width:952px; height=435px" autoplay="autoplay">
  Not supported by your browser
</video>

然而,我看到的却是黑色 div中间有一个 X,好像问题出在缺少插件。我试着打开 this page在 IE9 中运行良好。

最佳答案

使用这段代码进行特征检测:

function supports_video() {
    return !!document.createElement('video').canPlayType;
}

由 dive into html5 提供:http://diveintohtml5.info/detect.html

关于Internet Explorer 8 中的 HTML5 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10418593/

相关文章:

javascript - 使用 jquery 进行多文件上传,有限制

javascript - 如何对一个 textarea 组件的文本值进行数据绑定(bind)并更新它?

servlets - Chrome(或 chrome 框架)发送两个或多个请求而不是一个?

html - 如何创建一个居中的 <div>,如果它不适合视口(viewport),它会自动缩小?

javascript - IOS发送暂停视频到html5

html - div 中的图像在图像下方有额外的空间

javascript - map 总是返回未定义

html - Css 背景视频

android - 如何在 android 中隐藏 Intent Chooser 窗口?

Android mjpeg 流到视频 MP4