【问题标题】:jPlayer mobile http request (not working)jPlayer 移动 http 请求(不工作)
【发布时间】:2014-06-29 19:52:34
【问题描述】:

我正在将 jPlayer 用于网站,一切正常,但在移动设备上我似乎无法获得任何音频 - 所有 mp3 http 请求都被取消,没有预览或响应。我可以通过直接链接在移动设备上播放 mp3(在 android 上测试)。

https://www.lisssten.com/

这是播放 mp3 的功能。我尝试了不同的音频文件,使用 flash 等,但似乎没有任何效果,所以我只能假设这是一个请求问题:

$('.jp-jplayer').each(function(index, val){

  $(this).jPlayer({

    ready: function() {

      $(this).jPlayer("setMedia", {
        mp3: 'audio/file'+ (index + 1) +'.mp3',
      })
      .bind($.jPlayer.event.volumechange, volumeCallback);

    },    
    solution: "html, flash",
    supplied: "mp3",
    preload: "auto",
    swfPath: 'js',
    loop: true,
  });

});

【问题讨论】:

    标签: jquery audio mobile mp3 jplayer


    【解决方案1】:

    更改代码以指定您提供 m4a 而不是 mp3,但仍保留指向 mp3 的链接,如下所示:

    $('.jp-jplayer').each(function(index, val){
    
      $(this).jPlayer({
    
        ready: function() {
    
          $(this).jPlayer("setMedia", {
            m4a: 'audio/file'+ (index + 1) +'.mp3',
          })
          .bind($.jPlayer.event.volumechange, volumeCallback);
    
        },    
        solution: "html, flash",
        supplied: "m4a",
        preload: "auto",
        swfPath: 'js',
        loop: true,
      });
    
    });
    

    【讨论】:

    • 谢谢,但恐怕这不起作用,即使在 chrome 中它也会停止播放文件
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-06
    • 2018-03-30
    • 2012-05-20
    • 1970-01-01
    • 1970-01-01
    • 2013-10-22
    • 2016-03-05
    相关资源
    最近更新 更多