我在我的網站中使用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