Finally iOS 10 lets you play videos inline!

As a web developer, a constant frustration has been Apple’s decision to basically hijack any video player and play the video through their full-screen player. I mean I get the reasoning, especially with the first iPhones. The screen was so small that watching an inline video or using touch controls at that size could be a chore. The only caveat to that rule was with an iPad, where inline video was kosher. But it’s been 9 years since the phone first launched, time to get with the program. Thankfully with iOS 10 they have; sort of.

Videos still open up in full-screen by default, but now you have the option to minimize it back into the page with the video still playing. Simply click the little double arrows in the bottom right corner of your full-screen video and boom, you’re good to go. To force the video to play inline by default, you need to add one line to your video embed code:playsinline webkit-playsinline="webkit-playsinline"
Thats it. Now your video will play inline for any phone running iOS 10.