video players with js API and iPhones

2019-07-27 13:57发布

问题:

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