MPMovieVIewController显示空白屏幕

时间:2015-10-09 09:13:25

标签: ios swift mpmovieplayercontroller

是的,这是我的代码:

import Foundation

class FbVideoPostDetailedViewController: FbDetailedPostViewController {

    var mc = MPMoviePlayerController()

    override func viewDidLoad() {
        super.viewDidLoad()

        let movieURL = NSURL(string: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
        self.mc = MPMoviePlayerController.init(contentURL: movieURL)
        self.mc.allowsAirPlay = false
        self.mc.shouldAutoplay = true
        self.mc.view.frame = UIScreen.mainScreen().bounds
        self.mc.controlStyle = MPMovieControlStyle.Embedded
        self.view.addSubview(self.mc.view)
        self.mc.fullscreen = true
        self.mc.play()

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

我只想尝试以全屏模式打开视频。请以正确的方式指导我,因为FbVideoPostDetailedViewController仅显示为空白屏幕且视频无法播放。

FbDetailedPostViewController我的网点很少,但我现在甚至想要全屏播放。

0 个答案:

没有答案