video players with js API and iPhones

房东的猫 提交于 2019-12-11 07:24:40

问题


I would like video start to play when use clicks on the specific element on my site. I tested vimeo player and youtube video player It works great on the desktop, but when I tested on the iPhone it doesn't.

I know that Apple doesn't allow autoplay. From Apple documentation "Warning: To prevent unsolicited downloads over cellular networks at the user’s expense, embedded media cannot be played automatically in Safari on iOS — the user always initiates playback."

My question is when user click on some html element on the site - can it be considered as initiation of playback by user? How did you solve such problems on the iPhones?


回答1:


Apparently clicking on an element should allow initiation of a Vimeo video in iOS, but according to a staff member on the Vimeo forums, a mystery bug is preventing this from working.

From https://vimeo.com/forums/help/topic:107150

On iOS, playback can only be initiated from a user action. When calling play with the API, somewhere along the line that user action is lost, and triggering the actual video to play doesn't work. We've tried to find a way around it, but so far nothing we've tried has worked.




回答2:


Actually this restriction is imposed from Apple side further answer Please see the answer



来源:https://stackoverflow.com/questions/20243923/video-players-with-js-api-and-iphones

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