0
Im使用SplitViewController和Swift-YouTube-Player在應用程序中播放YouTube視頻。它在iPhone上完美運行,但它不適用於iPad。無法在iPad上播放YouTubePlayer視圖
在iPhone上,當我觸發播放器時,它會打開MPMoviewPLayer全屏並播放視頻,但在iPad上它播放的背景我認爲,我可以播放視頻的聲音,但不會顯示視頻。
我找不到解決方案。你有什麼建議,爲什麼玩家在splitviewcontroller下玩?
這裏是觸發代碼
timer = NSTimer.scheduledTimerWithTimeInterval(4, target: self, selector: "alertVideo", userInfo: nil, repeats: false)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "doneButton", name: UIWindowDidBecomeHiddenNotification, object:nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "startVideo", name: UIWindowDidBecomeVisibleNotification , object:nil)
let a = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
a.dimBackground = true
collectionView.deselectItemAtIndexPath(indexPath, animated: true)
let cell = collectionView.cellForItemAtIndexPath(indexPath)
let circleView : YouTubePlayerView? = (cell!.contentView.viewWithTag(10)) as? YouTubePlayerView
circleView?.play()
,這是YouTubePLayer我使用: https://github.com/gilesvangruisen/Swift-YouTube-Player