Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

internet explorer 10 - IE10 not playing a video when using the <video> tag, but plays it when requesting the video directly

I have a webpage with a tag on it with the following markup:

<video width="456" height="360" controls autoplay>
    <source src="Movies/Intro.mp4" type="video/mp4" />
    <source src="Movies/Intro_H264.webm" type='video/webm; codecs="vp8.0, vorbis"'/>
    <source src="Movies/Intro_H264.ogg" type='video/ogg; codecs="theora, vorbis"'/>
</video>

If I visit this page in IE10 it renders the video player but with an error message that reads: "Error: unsupported video type of invalid file path"

But what's odd is if I right-click on the video box and choose, Copy video URL, and then open a new tab in IE and paste in the direct URL to the video file (Movies/Intro.mp4) it plays in the browser without issue.

Also, I can visit the page using Chrome and it plays the MP4 video from the webpage without issue. All that to say, I don't think there's any issue with the video file itself or the encoding, but why is IE 10 not playing the video when it's in the tag, but it is playing it when requesting the video directly?

Any insights?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I would check whether the mime-type is correctly being returned for the file.

Chrome will play correctly regardless of the MIME Type returned.

To check:

  1. Press F12 to display the IE Tools Window/Pane.
  2. Go to the Network Tab
  3. Click Start Capturing
  4. Browse to the page in question
  5. Find the mp4 line
  6. If the Type is displayed as application/octect-stream then this is your issue.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...