简体   繁体   English

Firefox选择.mp4视频而不是.ogv

[英]Firefox selecting .mp4 video instead of .ogv

So I have this peculiar problem with HTML5 , whenever I try to play my video on my website with Firefox it plays the .mp4 video instead of the .ogv 所以我在HTML5上遇到这个特殊的问题,每当我尝试使用Firefox在我的网站上播放视频时,它都会播放.mp4视频而不是.ogv

Code: 码:

<tr>
    <td>
      <video id="player" width="100%" height="auto" title="" controls runat="server" onclick="this.play();">
        <source runat="server" id="ffVideo" type="video/ogv" onclick="this.play();" />
        <source runat="server" id="mp4Video" type="video/mp4" onclick="this.play();" />
      </video>
      <embed id="playerOld" width="680px" autostart="false" allowfullscreen="true" height="383px"
        title="" style="display: none" type="application/mp4" runat="server" />
    </td>
  </tr>

The src gets filled dynamically from the code behind. src从后面的代码动态填充。

Code behind: 后面的代码:

Public Property vidSrc As String
    Get
      Return player.Attributes("src")
    End Get
    Set(ByVal Value As String)
      mp4Video.Attributes("src") = Value + ".mp4"
      ffVideo.Attributes("src") = Value + ".ogv"
      playerOld.Attributes("src") = Value + ".mp4"
    End Set
  End Property

Can anyone please help? 谁能帮忙吗?

Gecko recognizes the following MIME types as Ogg files: Gecko将以下MIME类型识别为Ogg文件:

  • audio/ogg An Ogg file containing only audio. audio / ogg一个仅包含音频的Ogg文件。
  • video/ogg An ogg file containing video (and possibly also audio). video / ogg一个包含视频(可能还有音频)的ogg文件。
  • application/ogg An Ogg file with unspecified content. application / ogg具有未指定内容的Ogg文件。 Using one of the other two MIME types is preferred, but you can use this if you don't know what the contents of the file are. 最好使用其他两种MIME类型之一,但是如果您不知道文件的内容,则可以使用它。

source: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats 来源: https : //developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats

no video/ogv in the list which is why it uses the one format it does support 列表中没有视频/ ogv,这就是为什么它使用它支持的一种格式的原因

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM