我正在加载一个 webvtt 文件。工作正常,但在 IE11 中没有提示。
WEBVTT FILE
00:00:01.000 --> 00:00:04.000
Let's take a look at the 4th platform preview of IE10
00:00:04.000 --> 00:00:06.000
running on the Windows 8 Developer Preview
代码内部:
var trackNode = jQuery("<track default>");
// videoNode is just a <video> with <source> child
videoNode.append(trackNode);
trackNode.attr({
label: "Captions",
kind: "metadata",
src: "localhost:1234/example&output=vtt"
});
trackNode.on("load", function() { // I have also tried using "loadedmetadata" instead of load, but nothing changed
console.log(this.track.cues.length);
});
在 Chrome 中我可以看到有 2 个提示,但在 IE11 中我看到 0
即使在所有内容都加载完毕并将其放入控制台后:
jQuery("track").track.cues.length
我仍然在 IE 中得到 0,在 Chrome 中得到 2
我错过了什么吗?
更新 1:
在做了一些重构之后,我在控制台中看到了这个错误:MEDIA12604: Text Track: Unknown MIME type。小时=8007000b。
然后我发现了这篇文章: WinJS 视频元素中的 HTTP 字幕
我认为这可能是服务器问题。
更新 2:
MEDIA12604:文本轨道:未知的 MIME 类型。小时=8007000b。已排序,但曲目提示仍未在 IE 中加载