I am currently trying to implement a MPMoviePlayerController
in my Swift app. When the video is loaded (by clicking a button on previous view controller) I would like the video to go in to full screen mode. With my current code this works perfectly in portrait but as soon as the video is rotated to landscape it only takes up half the screen. Is there some way I can get around this issue?
Here is my code:
override func viewDidLoad() {
super.viewDidLoad()
var url:NSURL = NSURL(string: "http://jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v")
moviePlayer = MPMoviePlayerController(contentURL: url)
moviePlayer.view.frame = CGRect(x: 20, y: 100, width: 200, height: 150)
self.view.addSubview(moviePlayer.view)
moviePlayer.fullscreen = true
moviePlayer.controlStyle = MPMovieControlStyle.Embedded}
And here are a few screenshots to help explain what I mean: