2
は、私は次のコードでユーチューブからビデオを埋め込むしようとしています:IOSユーチューブ埋め込まれたビデオフレームの問題
func setUpVideo() {
let width = webView.frame.width
let height = webView.frame.height
let frame = 0
bmiWebView.allowsInlineMediaPlayback = true
let videoUrl = "https://www.youtube.com/embed/GCALWdwKr48"
let htmlUrl = "<html><body><iframe width=\(width) height=\(height) src=\(videoUrl)?&playsinline = 1 frameborder=\(frame) allowfullscreen></iframe></body></html>"
webView.loadHTMLString(htmlUrl, baseURL: NSBundle.mainBundle().bundleURL)
}
私は白い背景で最初にビデオをロードすることができるよそれがロードするときには、以下のようになります。 。なぜ白い背景があるのか分かりません。誰かがそれを取り除く方法を教えてくれれば本当に役に立ちます。ありがとうございました。
をそのための最善の方法がある---> https://developers.google.com/youtube/ v3/guides/ios_youtube_helper、その他のswift用ライブラリはhttps://github.com/gilesvangruisen/Swift-YouTube-Playerです – jose920405