gpt4 book ai didi

android - jPlayer持续时间和进度错误

转载 作者:行者123 更新时间:2023-11-29 01:36:37 26 4
gpt4 key购买 nike

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

编辑:这是我当前的 fiddle

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 slider

$("#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,没有

最佳答案

终于!

我发现哪里出了问题...

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

错误在服务器!!!
它启用了gzip 压缩

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

Do Not GZIP the Media

Disable GZIP encoding of all the media files. Media files are already >compressed and the GZIP will just waste CPU on your server.

The Adobe Flash Plugin will experience issues if you GZIP the media.

Do not GZIP the Jplayer.swf file either. Feel free to GZIP the JavaScript

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

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

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

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

关于android - jPlayer持续时间和进度错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27559418/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com