搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

video tag doesn't work

  • 2 回覆
  • 5 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

I don't know why, but a video doesn't play on Firefox. This is the code:

<video id="video-element" preload="auto" loop="loop" autoplay="true" class="bg-video" data-video-width="1280" data-video-height="720">
   <source src="video.webm" type="video/webm"></source>
   <source src="video.ogv" type="video/ogg"></source>
   <source src="video.mp4" type="video/mp4"></source>
  Your browser does not support the <code>video</code> element.
</video>

I have all the formats, I used http://firefogg.org for that. When I try it on local computer, it works, but on the server doesn't.

Could anyone explain the problem, please?

I don't know why, but a video doesn't play on Firefox. This is the code: <pre><nowiki><video id="video-element" preload="auto" loop="loop" autoplay="true" class="bg-video" data-video-width="1280" data-video-height="720"> <source src="video.webm" type="video/webm"></source> <source src="video.ogv" type="video/ogg"></source> <source src="video.mp4" type="video/mp4"></source> Your browser does not support the <code>video</code> element. </video> </nowiki></pre> I have all the formats, I used http://firefogg.org for that. When I try it on local computer, it works, but on the server doesn't. Could anyone explain the problem, please?

由 cor-el 於 修改

所有回覆 (2)

more options

Strange, but the code is not shown. Should I write it in another format?

Anyways, I made a screenshot.

由 frecklyy 於 修改

more options

Is the server configured to send this file with a correct MIME type?

Does it work if you open the URL of a WebM or Ogg movie via the location bar?