jquery - jPlayer 2.0 iPhone/手机问题

标签 jquery iphone jquery-ui html jplayer

我在我的网站中使用 jPlayer 2.0。 我检测到移动用户。

基于此:

  1. 我将他们重定向到另一个链接。
  2. 由于自动播放没有开始,我要求他们按播放键。
  3. 此后,同一按钮变为静音/取消静音按钮(音量更改为 0/100);

这是函数。注意手机= 1 部分。 mobile = 1 变量在移动设备(来 self 的后端)时设置

除了手机中的静音/取消静音之外,一切正常。

 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不支持音量支持吗

最佳答案

我在 jPlayer 的官方群组页面中提出了同样的问题。得到的答案如下:

Mobile browsers do not allow us to change the volume nor muted values of the media element. This is by their browser design and there is nothing we can do about it at this time. They expect you to use their physical volume buttons on the device to control the volume.

All you could do is browser sniff for the mobile browser and hide those controls since they do nothing.

所以问题不在于脚本,而在于手机中的浏览器,它阻止我更改音量,

关于jquery - jPlayer 2.0 iPhone/手机问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6099740/

相关文章:

jquery - 如何使用 Jquery 更改给定的输入单选值?

ios - UIImage Scale Aspect Fill 和 Clip Subviews 在 UICollectionView 中不起作用

jquery - jQuery UI 可排序的动画过渡

javascript - 允许用户添加表单输入字段: Why is append() only working once?

jquery - 电子邮件分隔符类似于 gmail

ios - 点击 UITableView 单元格正在创建一个新单元格

iphone - 如何在 Swift 中以编程方式将联系人设置为最喜欢的联系人?

JQuery UI 拖放和对齐

javascript - 如何使用prototype.js和jquery UI?

jquery - 链接标题标签通过 ajax 悬停元素显示