我在我的网站中使用jPlayer 2.0。 我检测到移动用户。jPlayer 2.0 iPhone /手机问题
基础上:
- 我把它们重新定向到另一个链接。
- 由于自动播放不启动,我要求他们按播放。
- 之后,相同的按钮变成静音/取消静音按钮(volueme更改0/100);
这里是函数。注意mobile = 1部分。 移动= 1个变量被设置时,其在移动(从我的后端)
它所有的工作,除了在移动台的静音/取消静音细。
function pauseOrPlay()
{
if(mobile == 1 && MOBILE_PLAY == 0)
{
// alert("s");
$('#jquery_jplayer_1').jPlayer('play');
MOBILE_PLAY = 1;
$("#message").text("playing... enjoy the music");
$("#message").fadeTo(2000,.3);
$("#message").slideUp(2000);
return;
}
if(playing == 1)
{
if(mobile == 1)
{
$('#jquery_jplayer_1').jPlayer("volume", 0);
}
else
{
$('#jquery_jplayer_1').jPlayer('mute');
}
playing = 0;
}
else
{
if(mobile == 1)
{
$('#jquery_jplayer_1').jPlayer("volume", 1);
}
else
{
$('#jquery_jplayer_1').jPlayer('unmute');
}
playing = 1;
}
}
这里是链接 原件(重定向基于移动/ PC之前)player 只需将链接手机 - here
我的问题:为什么它不是手机只工作
iPhone不支持音量支持
你应该做在客户端上的触摸设备检测。 var is_touch_device =(document.documentElement中的'ontouchstart')?true:false;' – KevBurnsJr 2011-06-23 00:02:21