У меня возникают проблемы с макетами с встроенным видео YouTube. Фактически Apple только что отклонила приложение, которое я отправил им по этим причинам. Это код, который я представил.Авто макет с встраиванием видео YouTube
import UIKit
class ImproveViewController: UIViewController {
@IBOutlet weak var videoView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let youTubeUrl = "https://www.youtube.com/embed/NpepI1dtIz8"
videoView.allowsInlineMediaPlayback = true
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.videoView.loadHTMLString("<iframe width=\"\(self.videoView.frame.width)\" height=\"\(self.videoView.frame.height)\" src=\"\(youTubeUrl)\" frameborder=\"0\" allowfullscreen></iframe>", baseURL: nil)
print("This is run on the main queue, after the previous code in outer block")
})
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
Это похоже на то, что я запускаю в симуляторе.
Как это можно исправить? Любая помощь будет оценена. Я добавил ограничения веб-просмотра на весь экран. В очередной раз благодарим за помощь.
Хорошо, я буду смотреть на что, когда я вернусь домой. Я думал, что мог бы сделать это с помощью Web View. – AltBrian