【发布时间】:2016-10-20 17:56:46
【问题描述】:
我终于设法在 UIWebView 中显示我的 vimeo 视频。 UIWebView 的大小是 w=280, h = 204。
这就是视频在 UIWebView 中的适配方式:
然后我可以将视频拖到我希望在加载视图时首先出现的位置:
这是我用来显示视频的代码:
let embedHTML="<html><head><style type=\"text/css\">body {background-color: transparent;color: white;}</style></head><body style=\"margin:0\"><iframe src=\"//player.vimeo.com/video/171151492?autoplay=1&loop=1\" width=\"280\" height=\"204\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
webView.delegate = self
let url: NSURL = NSURL(string: "https://player.vimeo.com/video/171151492")!
webView.loadHTMLString(embedHTML as String, baseURL:url )
【问题讨论】:
标签: ios iphone swift uiwebview vimeo