即使在编解码器之后,HTML视频标签也无法在IE 11中运行

时间:2018-10-26 16:15:58

标签: html html5-video internet-explorer-11

我有视频

    <div id="video" style="--aspect-ratio:3/1;">
	<video autoplay muted loop>
		<source src="fotky/video.mp4" type='video/mp4; codecs=" H.264/MPEG-4"'>
			<source src="fotky/video.ogv" type="video/ogv" >
		<source src="fotky/video.webm" type="video/webm" >
			<p>Váš prohlížeč nepodporuje video</p>
	</video>
</div>

在IE 11中,它什么也不显示。我试过像here这样的编解码器。但甚至type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'都不起作用。

我该怎么做才能使其正常工作?还有其他编解码器吗?

编辑:

<div id="video" style="--aspect-ratio:3/1;">
<video autoplay muted loop>
    <source src="fotky/video.mp4" type="video/mp4">
        <source src="fotky/video.ogv" type="video/ogv" >
    <source src="fotky/video.webm" type="video/webm" >
        <p>Váš prohlížeč nepodporuje video</p>
</video>

1 个答案:

答案 0 :(得分:0)

尝试删除编解码器,并在IE 11中通过双引号将类型传递给我。

<!doctype html>
<head>
</head>
<body>
  <div id="video" style="--aspect-ratio:3/1;">
	<video autoplay muted loop>
		<source src="C:\Users\Administrator\Desktop\SampleVideo.mp4" type="video/mp4">
			<source src="fotky/video.ogv" type="video/ogv" >
		<source src="C:\Users\Administrator\Desktop\big-buck-bunny_trailer.webm" type="video/webm" >
			<p>Váš prohlížec nepodporuje video</p>
	</video>
</div>
</body>
</html>

输出:

enter image description here