1

打开直接指向音频播放器的链接时,所有浏览器都会播放它们。Audioplayer 在嵌套的 div 中,它是指向 swf 的嵌入元素。

但是当写入并将其嵌入某些页面时会显示播放器,但它不会在 IE8 中播放。适用于所有其他主要浏览器,包括 IE9。

顺便说一句,它在 Safari 中不起作用,但是为 Safari 分配足够大的值的宽度和高度修复了它,但不是 IE8。

<iframe width="500" height="50" src="http://localhost/getAudio?id=DB04DDA8-C7C9-46E6-B0B3-7A0E0B5C9A55" frameBorder="0" scrolling="no">

<html class=" js no-flexbox no-canvas no-canvastext no-webgl no-touch no-geolocation postmessage no-websqldatabase no-indexeddb hashchange no-history draganddrop no-websockets no-rgba no-hsla no-multiplebgs no-backgroundsize no-borderimage no-borderradius no-boxshadow no-textshadow no-opacity no-cssanimations no-csscolumns no-cssgradients no-cssreflections no-csstransforms no-csstransforms3d no-csstransitions fontface generatedcontent no-video no-audio localstorage sessionstorage no-webworkers no-applicationcache no-svg no-inlinesvg no-smil no-svgclippaths" xmlns="http://www.w3.org/1999/xhtml">

<HEAD>
<STYLE class=iepp-printshim media=print></STYLE>
<TITLE>Bethoven symphony # 9</TITLE>
<META charset=utf-8>
<SCRIPT type=text/javascript src="/celenium/scripts/libs/jquery-latest.js"></SCRIPT>


<SCRIPT type=text/javascript src="/celenium/scripts/ClientCompatibility.js"></SCRIPT>

<STYLE type=text/css>BODY {
    PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
</STYLE>
</HEAD>
<BODY>
<DIV id=asset01>
<SCRIPT type=text/javascript>
            $.ajax({
                url: '/celenium/audioplayer_html5/getPlayer.asp?o=DB04DDA8-C7C9-46E6-B0B3-7A0E0B5C9A55',
                dataType: 'jsonp',
                cache: true,
                jsonpCallback: 'sdlaudioplayer',
                success: function (data) {
                    $('#asset01').append($(data.html));
                }
            });    
        </SCRIPT>
<LINK rel=stylesheet href="http://localhost/celenium/audioplayer_html5/css/defaultplayer.css" media=screen>
<DIV id=sdlaudioplayer class=player_container>
<DIV class=player_metabar></DIV>
<DIV class=player_controls>
<DIV style="DISPLAY: block" class=player_controls_play jQuery1707536265854468271="1"></DIV>
<DIV style="DISPLAY: none" class=player_controls_pause jQuery1707536265854468271="2"></DIV>
<DIV style="DISPLAY: none" class=player_controls_prev jQuery1707536265854468271="3"></DIV>
<DIV style="DISPLAY: none" class=player_controls_next jQuery1707536265854468271="4"></DIV>
<DIV style="WIDTH: 297px; DISPLAY: block" class=player_controls_scrubber jQuery1707536265854468271="5">
<DIV class=player_controls_scrubber_loading jQuery1707536265854468271="13">
<DIV class=player_controls_scrubber_loaded></DIV>
<DIV class=player_controls_scrubber_playhead></DIV></DIV></DIV>
<DIV style="DISPLAY: block" class=player_controls_timing jQuery1707536265854468271="6"><SPAN class=player_controls_timing_position>0:00</SPAN> / <SPAN class=player_controls_timing_total>0:00</SPAN></DIV>
<DIV style="DISPLAY: block" class=player_controls_volume jQuery1707536265854468271="7">
<DIV class=player_controls_volume_mute jQuery1707536265854468271="8"></DIV>
<DIV class=player_controls_volume_slider jQuery1707536265854468271="12">
<DIV style="WIDTH: 50%" class=player_controls_volume_marker jQuery1707536265854468271="11"></DIV>
<DIV style="LEFT: 28px" class=player_controls_volume_knob jQuery1707536265854468271="10"></DIV></DIV>
<DIV class=player_controls_volume_max jQuery1707536265854468271="9"></DIV></DIV></DIV></DIV>
<DIV id=sm2-container class="high_performance movieContainer swf_loaded"><!-- SM2 flash goes here -->
<DIV></DIV>
<DIV class=sm2-object-box>
<OBJECT id=sm2movie title="JS/Flash audio component (SoundManager 2)" codeBase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 data="/celenium/audioplayer_html5/swf/soundmanager2_flash9.swf" width=auto type=application/x-shockwave-flash height=auto></OBJECT></DIV></DIV></DIV></BODY>
4

1 回答 1

1

IE8 不被认为是现代浏览器,因为它不支持许多 HTML5 功能,例如音频和视频标签。

这个HTML5 教程站点有一个示例,说明如何使用 Object 标签在 IE8 中支持音频。请参见下面的示例:

<audio controls>
    <source src="vincent.mp3" type="audio/mpeg"/>
    <source src="vincent.ogg" type="audio/ogg"/>
    <object type="application/x-shockwave-flash" data="media/OriginalMusicPlayer.swf" 
      width="225" height="86"> 
       <param name="movie" value="media/OriginalMusicPlayer.swf"/>
       <param name="FlashVars" value="mediaPath=vincent.mp3" /> 
    </object> 
</audio>

请记住,这需要 IE8 客户端安装 Flash,因为它使用 Flash 加载播放器。

如果客户端没有安装 Flash,你最后的努力就是简单地提供一个下载链接,让用户使用操作系统的默认播放器来播放音频文件:

<audio controls>
    <source src="vincent.mp3" type="audio/mpeg"/>
    <source src="vincent.ogg" type="audio/ogg"/>
    <object type="application/x-shockwave-flash" data="media/OriginalMusicPlayer.swf"  
      width="225" height="86"> 
        <param name="movie" value="media/OriginalMusicPlayer.swf"/>
        <param name="FlashVars" value="mediaPath=vincent.mp3" /> 
    </object> 
    <a href="vincent.mp3">Download this lovely song and wish you all the best!</a>
</audio>

作为旁注,您面临的问题很可能源于您的 HTML 缺少 html5 文档类型并包含验证错误这一事实。您可能需要查看 W3C 规范。我相信你所有的属性都应该有引号。

尽管许多浏览器都擅长让您在 HTML 中犯语法和语义错误并随意处理它,但有时这些验证问题可能会再次困扰您。我强烈建议您针对W3C 验证器运行您的网站,以确保没有任何 HTML 错误阻止 IE8 正确解释您的标记。

于 2012-04-08T20:47:21.963 回答