jPlayer在移动Chrome中播放而不是mp3

时间:2014-07-16 07:57:34

标签: android jquery browser jplayer

拜托,拜托,你能帮帮我吗? 我正在使用jplayer。在桌面上所有浏览器都可以,在iOs上也可以在Android上播放。我正在使用mp3格式。如果我包含oga格式,它会以oga格式播放歌曲。有没有什么方法可以让jplayer能够在Android手机上播放mp3格式?

非常感谢你的解决方案。

这是我的来源:

<div class="media-player">
                                    <script>
                                        $(document).ready(function() {
                                            $("#jquery_jplayer_foot_mob_1").jPlayer({
                                                ready: function() {
                                                    $(this).jPlayer("setMedia", {
                                                        title: "4D - Zelený dym",
                                                        oga:"http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg",
                                                        mp3: "files/audio/4D---Zeleny-dym-(2012).mp3"
                                                    });
                                                },
                                                play: function() { // To avoid multiple jPlayers playing together.
                                                    $(this).jPlayer("pauseOthers");
                                                },
                                                errorAlerts: true,
                                                supplied: "oga, mp3",
                                                swfPath: "scripts/jplayer",
                                                solution: "html",
                                                cssSelectorAncestor: "#jp_container_foot_mob_1"
                                            });
                                        });
                                    </script>
                                    <div id="jquery_jplayer_foot_mob_1" class="jp-jplayer"></div>
                                    <div id="jp_container_foot_mob_1" class="jp-audio small cover">
                                        <div class="jp-type-single">
                                            <div class="jp-cover">
                                                <img src="styles/img/disc_1.png" />
                                            </div>
                                            <div class="jp-gui jp-interface">
                                                <ul class="jp-controls">
                                                    <li class="left"><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
                                                    <li class="right"><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
                                                    <div class="clear"></div>
                                                </ul>
                                                <div class="jp-progress">
                                                    <div class="jp-seek-bar">
                                                        <div class="jp-play-bar"></div>
                                                    </div>
                                                </div>
                                                <div class="jp-details">
                                                    <span class="jp-title"></span>
                                                    <div class="jp-time-holder">
                                                        <div class="jp-current-time"></div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="jp-no-solution">
                                                <span>Update Required</span>
                                                To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
                                            </div>
                                        </div></div>

2 个答案:

答案 0 :(得分:4)

它只是jPlayer的一个错误)

在2.7.1版中解决了这个问题

https://github.com/happyworm/jPlayer/releases/tag/2.7.1

答案 1 :(得分:2)

尝试更改代码以分配m4a而不是mp3,但仍然保持与mp3的链接。这对我有用:

$(document).ready(function() {
    $("#jquery_jplayer_foot_mob_1").jPlayer({
        ready: function() {
            $(this).jPlayer("setMedia", {
                title: "4D - Zelený dym"
                m4a: "files/audio/4D---Zeleny-dym-(2012).mp3"
            });
        },
        play: function() { // To avoid multiple jPlayers playing together.
            $(this).jPlayer("pauseOthers");
        },
        errorAlerts: true,
        supplied: "m4a",
        swfPath: "scripts/jplayer",
        solution: "html",
        cssSelectorAncestor: "#jp_container_foot_mob_1"
    });
});