我使用MPMoviePlayerController,我希望用户能够观看包含音频的视频,并能够继续收听已经在后台运行的Spotify或其他音乐应用。如何让我的应用程序播放电影并允许用户继续听音乐?
self.moviePlayer = MPMoviePlayerController(contentURL: url)
if var player = self.moviePlayer {
// let the preview loop
self.stopPreview = false
UIApplication.sharedApplication().statusBarHidden=true
player.view.frame = self.view.bounds
player.prepareToPlay()
player.scalingMode = .AspectFill
player.controlStyle = .None
self.view.addSubview(player.view)
// custom UI preview controlls
// Back button and send buttons
self.view.addSubview(self.confirmationView)
self.view.bringSubviewToFront(self.confirmationView)
}