I have webview displaying youtube video:
class ViewController: UIViewController {
@IBOutlet var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL(string: "http://www.cast.html")
let request = NSURLRequest(URL: url!)
webView.loadRequest(request)
}
HTML link looks like this:
<div class="h_iframe">
<iframe webkit-playsinline height="480" width="2" src="https://www.youtube.com/embed/ru1_lI84Wkw?feature=player_detailpage&playsinline=1" frameborder="0" allowfullscreen></iframe></div>
That works perfectly, but i want also to let user to watch it on the youtube app. Is it possible to create link in webview that launch YouTube app (if installed on device) ?
Any help appreciated.