fregante / iphone-inline-video

📱 Make videos playable inline on the iPhone (prevents automatic fullscreen)
https://npm.im/iphone-inline-video
MIT License
2.06k stars 298 forks source link

Not working on Ipad? #48

Closed 0xsven closed 8 years ago

0xsven commented 8 years ago

Is there a reason why it doesn't work on my ipad?

I am on iOS 9.2.1

fregante commented 8 years ago

What are you trying to do on the iPad? It's disabled by default because the iPad plays videos inline natively

0xsven commented 8 years ago

Thank's for the info.

Do you know if I have to do something to make them autoplay? I have put the attribute on the video element but it doesn't autoplay on iPad.

fregante commented 8 years ago

There is a third parameter that when set to false IIV will be run in all browsers, not just iPhone and iPod.

This is what you're looking for to enable silent auto playing videos on the iPad:

if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
    makeVideoPlayableInline(video, false /* hasAudio */, false /* false = run everywhere */);
}
fregante commented 7 years ago

In the v2 beta I simplified the usage on iPad. Can you try it and let me know how it goes?

fregante commented 7 years ago

v2.0.0 has been published :)

Now you can use the iPad option:

enableInlineVideo(video, {
    iPad: true
});