【问题标题】:jPlayer duration and progress errorjPlayer 持续时间和进度错误
【发布时间】:2014-12-19 03:48:26
【问题描述】:

我有几个 jPlayer 实例,显然具有不同的 id。

编辑:这是我目前的小提琴

http://jsfiddle.net/UrielUVD/8t52eqsp/

$("#jquery_jplayer_1").jPlayer({
  ready: function () {
    $(this).jPlayer("setMedia", {
      title: "test",
      mp3: "sourceofmp3"
  });
  },
  timeupdate: function(event) {
      $("#jp-progress-slider-1").slider("value",event.jPlayer.status.currentPercentAbsolute);
    },
  swfPath: "jquery.jplayer.swf",
  cssSelectorAncestor: '#jp_container_1',
  cssSelector:
  {
  play: '.icon-play1',
  pause: '.icon-pause1',
  seekBar: '.ui-slider',
  playBar: '.ui-slider-range',
  currentTime: '.jp-current-time',
  duration: '.jp-duration'
  },
  supplied: "mp3",
  solution_play: "flash, html",
  wmode: "window",
  mobile:true,
  preload: "metadata",
  volume: 1,
  duration:true,
  keyEnabled: true,
  errorAlerts: true
});

和他各自的jquery ui滑块

$("#jp-progress-slider-1").slider({
animate: "fast",
max: 100,
range: "min",
step: 0.1,
value : 0,
slide: function(event, ui) {
  var sp = $("#jquery_jplayer_1").data("jPlayer").status.seekPercent;

  if(sp > 0) {
    $("#jquery_jplayer_1").jPlayer("playHead", ui.value * (100 / sp));
  } else {

    setTimeout(function() {
      $( "#jp-progress-slider-1").slider("value", 0);
    }, 0);
  }
 }
});

在网络中一切正常,持续时间、当前时间、当前进度、事件和侦听器...

但在移动(adnroid)持续时间中,currentPercentAbsolute、currentPercentRelative 始终为 0 播放器正常播放、暂停和停止,但此状态值始终为 0 怎么了?

编辑1:到目前为止,这个错误只在Android Chrome 39中显示,没有

【问题讨论】:

    标签: android jquery google-chrome mobile jplayer


    【解决方案1】:

    终于!

    我发现出了什么问题...

    • JavaScript 代码没有错误
    • URL 源中没有错误
    • 音频 mime 类型没有错误
    • JQuery-ui、Jplayer 或 JPlayer.swf 中没有错误

    服务器出错!!!
    它已启用 gzip 压缩

    我在.htaccess中使用了SetEnv no-gzip 1来解决

    不要对媒体进行 GZIP 压缩

    禁用所有媒体文件的 GZIP 编码。媒体文件已经>压缩,GZIP 只会浪费你服务器上的 CPU。

    如果您对媒体进行 GZIP 压缩,Adobe Flash 插件会遇到问题。

    也不要对 Jplayer.swf 文件进行 GZIP 压缩。随意对 JavaScript 进行 GZIP 压缩

    http://jplayer.org/latest/developer-guide/

    这是迄今为止我发现的可能错误的唯一参考

    注意:到目前为止,此错误仅在 Android Chorme 中显示
    如果您在移动浏览器中尝试以下列表中的一些问题,请尝试一下

    • 音频播放,但未加载元数据
    • 尽管网址正确且可访问,但无法设置网址
    • 即使在播放音频时也无法触发 timeupdate 事件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-01
      • 2021-12-29
      • 1970-01-01
      • 2013-11-23
      • 1970-01-01
      • 2019-03-15
      • 2010-12-18
      • 2023-03-17
      相关资源
      最近更新 更多