Tôi có webview hiển thị youtube video:Khởi chạy ứng dụng YouTube trên thiết bị iOS
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)
}
liên kết HTML trông như thế này:
<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>
Đó hoạt động hoàn hảo, nhưng tôi cũng muốn cho phép người dùng để xem nó trên ứng dụng youtube. Có thể tạo liên kết trong chế độ xem web khởi chạy ứng dụng YouTube (nếu được cài đặt trên thiết bị) không?
Bất kỳ trợ giúp nào được đánh giá cao.
bản sao có thể có của [Ứng dụng YouTube mở YouTube với truy vấn (sơ đồ url)] (http://stackoverflow.com/ câu hỏi/18695537/ios-open-youtube-app-with-query-url-scheme) –