HTML5 inline video on iPhone vs iPad/Browser

HTMLWeb DevelopmentFront End Technology

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>
raja
Published on 20-Mar-2018 14:50:59
Advertisements