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

Pass through `timeupdate`, `seeked`, and `seeking` events #66

Closed justinanastos closed 8 years ago

justinanastos commented 8 years ago

This PR will use a CustomEvent for proxied events so it can attach a proxied flag on the event itself. Then we can detect if the event was proxied in the preventEvent and 'seeking' listeners to detect where the original event came from. Using this logic, we can safely passthrough timeupdate, seeking, and seeked events from the <audio> node to the consumer.

Please let me know what I can do to make this PR mergeable with your build-process.

Thanks!

Relates to #8, #57

fregante commented 8 years ago

Thank you! But as mentioned in #8:

I could also proxy them (and timeupdate) from audio element, but then what do I do with silent videos?

Given that the audio's seeking is triggered by exactly this point, I think the solution would be to just work around that to allow those events through.

timeupdate is already there and uses this technique. video[ಠevent] = true is how I allow an event through. That @event symbol for timeupdate is specified here and new symbols should be created to allow more events.

If you feel that it's a bit spaghetti, let me know if you find other solutions or want to refactor a bit, but please keep the code lightweight.

As for the built file, no need to include it :)

justinanastos commented 8 years ago

This doesn't work as well as I'd hoped. I'm closing it out.