jPlayer doesn't play audio file automatically in iPad

做~自己de王妃 提交于 2019-12-13 18:15:43

问题


I am trying to play audio file using jPlayer in iPad. It works fine in Safari on my local PC but when I tried to open it in my iPad it doesn't play audio automatically.

Please help me.

Thanks


回答1:


You may have to initialize jPlayer on user action in Mobile Safari.

The first time a media element is played must be initiated by a user gester. ie., The user must click the play button. This affects the operation of a jPlayer("play") in the ready event handler. The browser will ignore the command. jPlayer will simply wait until the user presses the play button. Once the first gesture has been received, JavaScript code is then allowed to do whatever you want with the media element. Note that a jPlayer media player instance uses a audio and a video element. Each require their own gesture.

As a hack, you could possibly add a handler for a touch event on an outer container element (or body) and initialize any jPlayer instances that you want.

Ref: http://www.jplayer.org/latest/developer-guide/#jPlayer-known-issues-event-driven




回答2:


Do you mean it doesn't play automatically? Because if it does, I don't see what your problem is.




回答3:


Check if you have entered the correct path for option swfPath.



来源:https://stackoverflow.com/questions/5898257/jplayer-doesnt-play-audio-file-automatically-in-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!