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

not working on devices pre iOS 10 #99

Closed Pau1fitz closed 7 years ago

Pau1fitz commented 7 years ago

I am trying to use this library to implement inline videos pre iOS10.

This works for inline videos on iOS10, but not for pre iOS10.

Is there something basic that I am missing?

My js looks like this

var video = $('video').get(0);
makeVideoPlayableInline(video, false);

video.addEventListener('touchstart', function () {
   video.play();
});

And the html looks like this

<video src='http://www.w3schools.com/html/mov_bbb.mp4' class="video-player video-one" id="video-background" autoplay muted playsinline>
</video>

CSS

.IIV::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button {
    opacity: 0;
    pointer-events: none;
    width: 5px;
}
Pau1fitz commented 7 years ago

Is there a version of ios and safari that it wont work on?

I am using v 8.3 of iOS and v600.1.4 of safari

fregante commented 7 years ago

Sorry, can you test the latest version of IIV (1.9.6)? 1.9.5 wasn't working

Pau1fitz commented 7 years ago

Hi, thanks for your response.

I am using this version:

https://github.com/bfred-it/iphone-inline-video/blob/master/dist/iphone-inline-video.browser.js

fregante commented 7 years ago

Did you download it today? I updated it just yesterday

Pau1fitz commented 7 years ago

I am sure I downloaded it today. I can check again tomorrow, but fairly certain I updated it earlier today and used the code here. I can compare the versions and confirm. Anything else you think it could be?

fregante commented 7 years ago

I think that's it, I only pushed it 14 hours ago. That exact file works on my iOS 8:

screencast

Pau1fitz commented 7 years ago

Thanks, that worked!