X
點擊此處開啟此網站的行動版。

技術支援討論區

Can't use video in <embed> tag

已張貼

I need to embed video using the <embed> tag rather than the <video> tag. Other browsers support this, but Firefox doesn't.

For example, this code:

    <figure>
        <embed src="myvid.mp4">
        <figcaption>
            myvid
        </figcaption>
    </figure>

works in Chrome. Firefox however ignores the embed source and only prints the content of the <figcaption> tag.

What's going on here? Does Firefox not support video in <embed> tags?

I need to embed video using the &lt;embed&gt; tag rather than the &lt;video&gt; tag. Other browsers support this, but Firefox doesn't. For example, this code: <pre><nowiki> <figure> <embed src="myvid.mp4"> <figcaption> myvid </figcaption> </figure></nowiki></pre> works in Chrome. Firefox however ignores the embed source and only prints the content of the &lt;figcaption&gt; tag. What's going on here? Does Firefox not support video in <embed> tags?

由 cor-el 於 修改

引用

額外的系統細節

已安裝的外掛程式

  • Shockwave Flash 26.0 r0

應用程式

  • User Agent: Mozilla/5.0 (Windows NT 6.1; rv:69.0) Gecko/20100101 Firefox/69.0

更多資訊

提出問題者

I need to embed video using the <embed> tag rather than the <video> tag. Other browsers support this, but Firefox doesn't.

For example, this code:

  <figure>
      <embed src="myvid.mp4">
      <figcaption>
          myvid
      </figcaption>
  </figure>

works in Chrome. Firefox however ignores the embed source and only prints the content of the <figcaption> tag.

What's going on here? Does Firefox not support video in <embed> tags?

I need to embed video using the <embed> tag rather than the &lt;video&gt; tag. Other browsers support this, but Firefox doesn't. For example, this code: <figure> <embed src="myvid.mp4"> <figcaption> myvid </figcaption> </figure> works in Chrome. Firefox however ignores the embed source and only prints the content of the <figcaption> tag. What's going on here? Does Firefox not support video in <embed> tags?

由 blackburn 於 修改

這篇文章有幫助嗎?
引用
cor-el
  • Top 10 Contributor
  • Moderator
17567 個解決方法 158879 個答案

With what content type does the server send this mp4 file ?

Did you check the Web Console?

  • "3-bar" menu button or Tools -> Web Developer

Try to add a type attribute

  • <embed src="myvid.mp4" type="video/mp4" >

Can you post a link to a publicly accessible page (i.e. no authentication or signing on required)?

With what content type does the server send this mp4 file ? Did you check the Web Console? *"3-bar" menu button or Tools -> Web Developer Try to add a type attribute *&lt;embed src="myvid.mp4" type="video/mp4" &gt; Can you post a link to a publicly accessible page (i.e. no authentication or signing on required)?
這篇文章有幫助嗎?
引用

提出問題者

Thanks for the interest. This page isn't being served by a webserver but is a local file. The HTML is rendered by Pandoc from Markdown. So I won't typically be able to add a 'type' key in the <embed> tag.

However, testing with

 <figure>
   <embed src="myvid.mp4" type="video/mp4">
   <figcaption>My video</figcaption>
 </figure>


show just the text "My video" in a red-lined box.

Works fine in Chrome.

Thanks for the interest. This page isn't being served by a webserver but is a local file. The HTML is rendered by Pandoc from Markdown. So I won't typically be able to add a 'type' key in the <embed> tag. However, testing with <div style="border: solid 1px red"> <figure> <embed src="myvid.mp4" type="video/mp4"> <figcaption>My video</figcaption> </figure> </div> show just the text "My video" in a red-lined box. Works fine in Chrome.
這篇文章有幫助嗎?
引用
cor-el
  • Top 10 Contributor
  • Moderator
17567 個解決方法 158879 個答案

Anything (possibly security) related to this in the Web Console ?

  • "3-bar" menu button or Tools -> Web Developer
Anything (possibly security) related to this in the Web Console ? *"3-bar" menu button or Tools -> Web Developer
這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題