1

您好我正在尝试在 uiwebview 中播放嵌入的 vimeo 视频。当我单击 webview 时,视频开始以纵向模式在默认播放器中播放,当我单击全屏按钮时,视频仅以纵向模式放大,而不是变成横向模式。请建议如何在横向模式下播放 vimeo 视频。提前致谢

    let embedHTML="<html><head><style type=\"text/css\">body {background-color: transparent;color: black;}</style><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes\"/></head><body style=\"margin:0\"><div><iframe src=\"//player.vimeo.com/video/139785390?autoplay=1&amp;title=1&amp;byline=1&amp;portrait=0\" width=\"640\" height=\"360\" frameborder=\"0\" webkit-playsinline webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></body></html>"
    let url: NSURL = NSURL(string: "https://vimeo.com/139785390")!
    webView.loadHTMLString(embedHTML as String, baseURL:url as URL )
    self.automaticallyAdjustsScrollViewInsets = false
    webView.allowsInlineMediaPlayback = true
    webView.contentMode = UIViewContentMode.scaleAspectFit
4

0 回答 0