fregante / iphone-inline-video

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

<source> might not work as well as <video src> #104

Open neo opened 7 years ago

neo commented 7 years ago

I figured doing the source tags like this:

<video>
  <source>
  <source>
</video>

is better than this and switch the src manually:

<video src="..." />

But it doesn't seem to work with me. It works on iOS 10 but not iOS 9, so I think it might be an issue with IIV.

Thanks

fregante commented 7 years ago

If you really need <source> you'll probably have to use the preload attribute and run enableInlineVideo() after loadstart

video.addEventListener('loadstart', function () {
  enableInlineVideo(video);
});

I've postponed doing this internally because it'd require non-trivial work to make the entire module async.

The alternative would be to just stick with src since mp4 is supported everywhere now.

neo commented 7 years ago

Thanks!