This is really cool! It’d be even better if you added “playsinline” attributes to your video elements so your videos didn’t play in fullscreen on iPhones.
12 karma · joined January 5, 2013
document.addEventListener('keypress', event => { if (event.key === 'space') video.play(); });
...then everything should just work fine.
Safari on iOS can now do inline playback! Just add a "playsinline" attribute to your <video> element: https://webkit.org/blog/6784/new-video-policies-for-ios/
The options are: "Allow all Auto Play", "Stop Media with Sound" (the default), and "Never Auto Play".
Site authors following the best practices section in the WebKit.org blog should provide a play button for video-backed-gifs when "Never Auto Play" causes automatic playback to block.