2

我正在尝试使用 jplayer 集成 iTunes 预览 url(m4a 文件)但遇到问题

Apple iTunes 中的所有文件都不起作用。例如:

http://a1.phobos.apple.com/us/r1000/057/Music/fd/8b/40/mzm.staswrxu.aac.p.m4a

但是,这 2 个 m4a(非苹果)链接有效:

http://jwdriggs.com/jagspodcast/m4a/%23116.m4a

他们自己在 iTunes 播放器中工作。

我能做些什么来让它们工作?它与iTunes编码有什么关系。如果这个问题有任何解决方法,那就太好了。

这是我的代码:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />

<!-- Website Design By: www.happyworm.com -->
<title>Demo : jPlayer circle player</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="skin/circle.skin/circle.player.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="js/jquery.transform.js"></script>
<script type="text/javascript" src="js/jquery.grab.js"></script>
<script type="text/javascript" src="js/mod.csstransforms.min.js"></script>
<script type="text/javascript" src="js/circle.player.js"></script>

<script type="text/javascript">
//<![CDATA[

$(document).ready(function(){

/*
 * Instance CirclePlayer inside jQuery doc ready
 *
 * CirclePlayer(jPlayerSelector, media, options)
 *   jPlayerSelector: String - The css selector of the jPlayer div.
 *   media: Object - The media object used in jPlayer("setMedia",media).
 *   options: Object - The jPlayer options.
 *
 * Multiple instances must set the cssSelectorAncestor in the jPlayer options.     Defaults to "#cp_container_1" in CirclePlayer.
 *
 * The CirclePlayer uses the default supplied:"m4a, oga" if not given, which is different from the jPlayer default of supplied:"mp3"
 * Note that the {wmode:"window"} option is set to ensure playback in Firefox 3.6 with the Flash solution.
 * However, the OGA format would be used in this case with the HTML solution.
 */

var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1",
{
    //m4a: "http://www.jplayer.org/audio/m4a/Miaow-07-Bubble.m4a"
    m4a: "http://a1549.phobos.apple.com/us/r1000/026/Music/d8/01/eb/mzm.mxkkesne.aac.p.m4a"
}, {
    cssSelectorAncestor: "#cp_container_1",
    swfPath: "js",
    wmode: "window"
});
});
//]]>
</script>
</head>
<body>

        <!-- The jPlayer div must not be hidden. Keep it at the root of the body element to avoid any such problems. -->
        <div id="jquery_jplayer_1" class="cp-jplayer"></div>

        <!-- The container for the interface can go where you want to display it. Show and hide it as you need. -->

        <div id="cp_container_1" class="cp-container">
            <div class="cp-buffer-holder"> <!-- .cp-gt50 only needed when buffer is > than 50% -->
                <div class="cp-buffer-1"></div>
                <div class="cp-buffer-2"></div>
            </div>
            <div class="cp-progress-holder"> <!-- .cp-gt50 only needed when progress is > than 50% -->
                <div class="cp-progress-1"></div>
                <div class="cp-progress-2"></div>
            </div>
            <div class="cp-circle-control"></div>
            <ul class="cp-controls">
                <li><a href="#" class="cp-play" tabindex="1">play</a></li>
                <li><a href="#" class="cp-pause" style="display:none;" tabindex="1">pause</a></li> <!-- Needs the inline style here, or jQuery.show() uses display:inline instead of display:block -->
            </ul>
        </div>



</body>

</html>
4

1 回答 1

0

尝试使用SoundManager2 - 这个库可以很好地播放 iTunes 音频预览。

于 2013-07-20T01:25:32.863 回答