Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"webkit-playsinline" video tag attribute

The <video> tag attribute webkit-playsinline supposedly prevents the default go to fullscreen behavior of HTML5 videos.

I added this attribute to my video tag and checked mobile safari and chrome on iOS6 iPhone and it doesn't work. The video still goes fullscreen. This is similar to others' experiences as described on SO two years ago.

What mobile browsers as of today, June 13th, 2013 does this attribute webkit-playsinline work?

like image 591
tim peterson Avatar asked Jun 13 '13 15:06

tim peterson


1 Answers

Apple has finally enabled the playsinline attribute on iOS 10, so this will work:

<video src="file.mp4" playsinline> 

I wrote a polyfill called iphone-inline-video that adds the same behavior to iOS 8 and 9.

like image 94
fregante Avatar answered Sep 21 '22 08:09

fregante