HTML5 inline video on iPhone vs iPad/Browser


The allowsInlineMediaPlayback  property of a UIWebView) enables/ disables in line media playback in the iOS web browser for a native app. 

By default, on iPhone this is set to NO, but on iPad its set to YES. Hence, the native video player takes over the screen, thus obstructing us from playing other dynamic content simultaneously with the video 

Adjust this behaviour in HTML as follows −

<video id = "myVideo" width = "280" height = "140" webkit-playsinline> 

iOS10+

 In iOS 10+, Apple has now enabled the attribute playsinline in all the web browsers on iOS 10. Now, play around with this easily −

<video src = "new.mp4" playsinline>

Updated on: 03-Mar-2020

378 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements