IE bug无效源HTML5音频 - 解决方法 [英] IE bug Invalid Source HTML5 audio - workaround

查看:1355
本文介绍了IE bug无效源HTML5音频 - 解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我(以及大约一百万人)在IE11中发现了一个错误(不确定其他版本是否有相同的错误),如果您创建HTML5音频标记,浏览器会报告无效来源,无论如何。我已经尝试过每一个我能想到的组合而没有运气。
到目前为止:
将HTML结束标记从自动关闭更改为显式
更改文件名以消除任何奇数字符
将音频子格式更改为每个可能的设置
添加显式URI(http:// ...)
禁用所有插件(库存插件上有)
尝试所有可能的音频格式
定义MIME类型
更改音频标签的参数。
更改了IIS设置以包含MIME类型。

I (and about a million others) have found a bug in IE11 (not sure if other versions have the same bug) where, if you create an HTML5 audio tag, the browser reports "Invalid Source" no matter what. I've tried every combination I can think of with no luck. So far: Changing the HTML end tags from self-closing to explicit Changing the file name to eliminate any odd characters Changing the audio sub format to every possible setting Adding an explicit URI ("http:// ...") Disabling all plugins (there were on the stock plugins) Trying every possible audio format Defining the MIME type Changing the audio tag's parameters. Changed the IIS settings to include the MIME types.

检查Microsoft的Connect网站 - (他们声称它不可复制,但有数百个数以千计的谷歌搜索结果表明不然。)

Checking Microsoft's "Connect" website - (they make the claim that it is not reproducible, but hundreds of thousands of Google results suggest otherwise).

这根本不可能吗?所有其他最新&我尝试过的最好的浏览器(FireFox,Opera,Safari,Chrome)
我现在已经结束了 - 没有解决办法。

Is this no possible at all? ALL other latest & greatest browsers I tried work (FireFox, Opera, Safari, Chrome) I'm at wit's end - no solutions work.

这是代码:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="AudioPopupPlayer.aspx.vb" Inherits="AudioPopupPlayer" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
        <div style="padding-top: 30px; margin: auto; width: 300px;">
        <asp:Literal ID="litVoiceOver" runat="server"></asp:Literal></div>
</body>
</html>

代码落后:

Partial Class AudioPopupPlayer
Inherits System.Web.UI.Page

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim VoiceOverFileName As String = Request.QueryString("vo")
    If VoiceOverFileName.Length > 0 Then
        Dim root As String = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + ResolveUrl("~/")
        Dim audiosource As String = "<audio id=""VoiceOver"" autoplay=""autoplay"" preload=""preload"" controls=""controls""><source src=""" & root & "audio/" & VoiceOverFileName & ".ogg"" type=""audio/ogg"" ></source><source src=""" & root & "audio/" & VoiceOverFileName & ".mp3"" type=""audio/mpeg"" ></source><source src=""" & root & "audio/" & VoiceOverFileName & ".wav"" type=""audio/wav"" ></source></audio>"
        Me.litVoiceOver.Text = audiosource
    End If
End Sub

 End Class

最后,屏幕截图(在IE11中)显示HTML呈现完美,但我仍然看到可怕的无效源消息(注意:复制和粘贴链接会导致要播放的音频文件 - 去图。)

And, finally, a screenshot (in IE11) showing that the HTML is rendered perfectly, yet I still get the dreaded "Invalid Source" message (NOTE: copying and pasting the link causes the audio file to play - go figure).

推荐答案

我在尝试使用简单的HTML5代码时遇到了同样的问题。网址和文件名也是正确的。这对我有用:

I had the same issue trying to use the simple HTML5 code. The url and file name were correct as well. This is what worked for me:

< audio src =song.mp3控制自动播放>< / audio>

如果您不需要它们,您可以删除控件,它仍然可以正常工作。我希望这有帮助!

You can remove the controls if you don't need them, it's still going to work. I hope this helps!

这篇关于IE bug无效源HTML5音频 - 解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆