I have embedded videos (pulled from YouTube API v3) into my iPhone app using a UIWebView as suggested. The problem is that some videos, such as those from VEVO, produce the fol
For Swift 4.2 of @JAL's answer you just need to do the following and it will work like a charm with vevo videos:
import UIKit
import youtube_ios_player_helper
class MyYoutubePlayerViewController: UIViewController {
@IBOutlet weak var playerView: YTPlayerView!
private var playerVars: [String : Any] = [
"playsinline" : 1,
"showinfo" : 1,
"rel" : 1,
"modestbranding" : 1,
"controls" : 1,
"origin" : "https://www.youtube.com" ]
override func viewDidLoad() {
super.viewDidLoad()
self.playerView.load(withVideoId: "YQHsXMglC9A", playerVars: playerVars)
}
}