“webkit-playsinline” video tag attribute

前端 未结 4 1125
[愿得一人]
[愿得一人] 2020-12-24 02:04

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

I added thi

相关标签:
4条回答
  • 2020-12-24 02:26

    The webkit-playsinline attribute works for HTML5 video on iOS4+ but only when you save the webpage to your home screen as a webapp. If you are using mobile Safari it will always open fullscreen.

    Theres a small blurb about its support here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

    I've also seen on recent versions of Android that inline video playback does work within its native browser.

    0 讨论(0)
  • 2020-12-24 02:35

    This worked for me. I tried to use playsinline inside of video tag. But it didn't work so I tried to set attribute from jQuery

    $('#you video tag id').attr('playsinline',''); 
    
    0 讨论(0)
  • 2020-12-24 02:36

    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.

    0 讨论(0)
  • 2020-12-24 02:41

    Looks like this might finally get implemented properly in iOS 10

    0 讨论(0)
提交回复
热议问题