swift - How do I prevent a video from going full screen when embedded using HTML5 and UIWebView? -
i embedding video application using uiwebview. desired behavior video not go full screen when user presses play. attempting achieve using
let htmlstring = "<iframe " + "src=\"https://streamable.com/e/2k8l?logo=0&playsinline=1&autoplay=1\" " + "width=\"\(width-20)\" height=\"\(height-20)\" " + "webkit-playsinline>" + "</iframe>" webview.scrollview.scrollenabled = false webview.allowsinlinemediaplayback = true webview.mediaplaybackrequiresuseraction = false webview.loadhtmlstring(htmlstring, baseurl: nsbundle.mainbundle().bundleurl)
since streamable link, "logo=0" removes streamable logo. autoplay desired , working fine; code playing video "inline" not working. have looked on ios reference uiwebview , additional requirement setting webview.allowsinlinemediaplayback = true
have add "webkit-playsinline"
html string.
i don't use html @ all, i'm not familiar , cannot figure out why video go full-screen. restriction placed streamable?? i'm not sure understand happening read going full-screen behavior in safari , save on ipads, html embed never play inline. presumably not using safari.
furthermore youtube link play videos inline fine. same code changing htmlstring so:
let htmlstring = "<iframe " + "width=\"\(width-20)\" height=\"\(height-20)\" " + "src=\"https://www.youtube.com/embed/obmm79yadym?autoplay=1&playsinline=1\">" + "</iframe>"
the video play inline desired not autoplay. going on here? behavior determined source?
Comments
Post a Comment