Jquery IE10中不支持Jplayer
MyjQuery代码:Jquery IE10中不支持Jplayer,jquery,jplayer,ogg,Jquery,Jplayer,Ogg,MyjQuery代码: <script type="text/javascript"> $(document).ready(function () { $("#jquery_jplayer_1").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { oga
<script type="text/javascript">
$(document).ready(function () {
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
oga: "/sound/cookingloop.ogg"
});
},
swfPath: "/js",
supplied: "oga"
});
});
</script>
$(文档).ready(函数(){
$(“#jquery_jplayer_1”).jplayer({
就绪:函数(){
$(this).jPlayer(“setMedia”{
oga:“/sound/cookingloop.ogg”
});
},
swfPath:“/js”,
提供:“oga”
});
});
HTML代码:
div id="jquery_jplayer_1">
</div>
<div id="jp_container_1">
<a href="#" class="jp-play">Play</a>
<a href="#" class="jp-pause">Pause</a>
</div>
divid=“jquery\jplayer\u 1”>
声音不能在IE中播放,但在Chrome和Firefox中工作正常。非常感谢您的帮助。也许您需要对其进行一些改进,以使其按您的意愿工作。并查找flash对象;)
函数getAudioPlayer($song\u path\u mp3,$song\u path\u ogg){
如果($song\u path\u mp3==null){
//在路径为空的情况下添加一些内容..或某些逻辑
//将路径添加到歌曲,以便只传递文件名。
}
if($song\u path\u ogg==null){
//在路径为空的情况下添加一些内容..或某些逻辑
//将路径添加到歌曲,以便只传递文件名。
}
$audio\u object='1
请记住,您需要更改get\u template\u directory\u uri()
到您需要的任何地方,因为这是一个wordpress函数,它返回模板url;-)据我所知IE10不支持Ogg Vorbis。您需要另一种格式。嗯,奇怪。这可能会有用——另一件事要确定的是,您的服务器为音频文件提供了正确的mime类型——Thnx pebbl。。…任何有助于在IEIE中播放ogg文件的帮助都不适用于ogg,它需要是mp3。。
function getAudioPlayer($song_path_mp3, $song_path_ogg){
if($song_path_mp3 == null){
//add something in case the path is null.. or some logic
//to add the path to the song, so you only pass the name of the file.
}
if($song_path_ogg == null){
//add something in case the path is null.. or some logic
//to add the path to the song, so you only pass the name of the file.
}
$audio_object = '
<!-- start: music player -->
<audio id="audio_with_controls" loop="loop" autoplay="autoplay" controls="controls">
<source src="path.mp3" type="audio/mpeg" />
<source src="path.ogg" type="video/ogg">
<object class="playerpreview" type="application/x-shockwave-flash"
data="<?php echo get_template_directory_uri();?>/flash/player_mp3_mini.swf" width="200" height="20" style="display:none;">
<param name="movie" value="<?php echo get_template_directory_uri();?>/flash/player_mp3_mini.swf" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true">
<param name="loop" value="true">
<param name="FlashVars" value="mp3=path.mp3" />
<embed href="<?php echo get_template_directory_uri();?>/flash/player_mp3_mini.swf" bgcolor="#000000" width="200"
height="20" name="movie" align=""
type="application/x-shockwave-flash" play="true" loop="true" flashvars="mp3=path.mp3">
</embed>
</object>
o
</audio>
<style type="text/css">
.audio_with_controls, .playerpreview, #player_fallback{display: none;}
</style>
<script src="http://www.google.com/jsapi"></script>
<script>google.load("swfobject", "2.2");</script>
<div id="player_fallback" style="display:none;"></div>
<script>
if (document.createElement("audio").canPlayType || document.createElement("video")) {
if (!document.createElement("audio").canPlayType("audio/mpeg") || !document.createElement("video").canPlayType("video/ogg")) {
var params = {
play: "true",
loop:"true",
bgcolor: "#000000",
}
swfobject.embedSWF(
"<?php echo get_template_directory_uri();?>/flash/player_mp3_mini.swf",
"player_fallback",
"200",
"20",
"9.0.0",
"",
{"mp3":"path.mp3"}, params);
}
}
</script>
<!-- end: music player -->
';
}