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 297 forks source link

Object.defineProperty crash on iOS7. #87

Closed phyllisstein closed 7 years ago

phyllisstein commented 7 years ago

Hey there! I noticed that attempting to use this polyfill on iOS7 causes a crash on proxy-property:14. It appears that the attributes of the video element aren't configurable, so trying to call Object.defineProperty on them fails:

screen shot 2

Not sure if iOS7 is meant to be officially supported---it's not mentioned in the README---but it'd be great if you could suggest a way around this. I'm reluctant to submit a PR since I have no good sense of the best way to handle the error, but I'm certainly open to suggestions.

fregante commented 7 years ago

There's a iOS 8-9 badge below the title. Unfortunately the behavior IIV depends on is not available on iOS 7, so there's no way around it

phyllisstein commented 7 years ago

Sure, of course. My thinking was less "this library should work on iOS <8" than "maybe this library could degrade more gracefully on iOS <8." Turned out that invoking it wrapped in a try...catch block was sufficient, though 😃 . Thanks for the response!

fregante commented 7 years ago

That's a good point. I'll detect iOS 7

fregante commented 7 years ago

Can you try version 1.9.5-0? I don't have an iOS 7 device to test this.

That version is currently installable with npm install iphone-inline-video@next or by downloading the latest file in dist on the repo

phyllisstein commented 7 years ago

Beautiful! That seems to resolve the crash on iOS7. I really appreciate your looking into this; thanks for taking the time.

fregante commented 7 years ago

Thanks for reporting back! It's been released as 1.9.5