Vide icon indicating copy to clipboard operation
Vide copied to clipboard

problems with autoplay iOS 9

Open Alvie-zz opened this issue 10 years ago • 7 comments

The autoplay doesn't work on iOS 9 (Safari). Can you fix this?

Alvie-zz avatar Dec 23 '15 08:12 Alvie-zz

I can confirm this issue. The video background on http://vodkabears.github.io/vide/ doesn't start playing under iOS 9 on my iPhone (Safari).

sirthias avatar Dec 23 '15 22:12 sirthias

iOS doesn't play video by default. So in vide it's made to default to the poster image. Pointed out in the docs.

iOS plays video from a browser only in the native player. So video for iOS is disabled, only fullscreen poster will be used.

ghost avatar Dec 23 '15 22:12 ghost

Ok, thanks for the clarification. I seem to have missed this part of the docs. So, would you say that the information on this page: http://caniuse.com/#feat=video is incorrect with regard to iOS?

sirthias avatar Dec 24 '15 08:12 sirthias

The information on caniuse.com is correct, ios supports the video element.

But...

https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html

In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.

vodkabears avatar Dec 24 '15 14:12 vodkabears

Thanks, Ilya, for this clarification! Makes sense. So I guess this ticket can be closed, no?

sirthias avatar Jan 06 '16 20:01 sirthias

Would the potential use of a user-initiated "Start" button or action be able to play a vide instance in mobile Safari iOS or Chrome iOS?

lukedanielson avatar Jan 18 '16 18:01 lukedanielson

@lukedanielson I recently implemented a 'start' button with an onclick event to play the vide video (via grabbing the vide instance's video object, see http://thimbleup.com ) - from my experience (tested under safari iOS 9.3 iphone6 simulator) the browser will still pop-up the video in it's own lightbox rather than let it play within the background.

This may suffice for some folks, but for my needs (I had hero text that synced with the background video), I may need to just make a separate video for iOS users.

Things work fine on chrome on android, firefox on android, or any desktop browser. Have not tested under chrome iOS or firefox iOS, but would expect a similar result to safari since from my understanding both have to still use webkit there.

seltzered avatar Apr 25 '16 16:04 seltzered