在横向模式下播放vimeo视频

时间:2017-03-20 11:12:34

标签: ios swift uiwebview vimeo-player vimeo-ios

您好我正在尝试在uiwebview中播放嵌入式vimeo视频。当我点击网页浏览时,视频开始以纵向模式在默认播放器中播放,当我点击全屏按钮时,视频仅放大了移植模式,而不是转向横向模式。请建议如何在横向模式下播放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

0 个答案:

没有答案