Ios MPMoviePlayerController并在后台播放来自其他应用程序(如spotify)的音频
我使用MPMoviePlayerController,我希望用户能够观看包含音频的视频,并能够继续收听他们的Spotify或其他已经在后台运行的音乐应用程序。如何允许我的应用程序播放电影并允许用户继续收听音乐Ios MPMoviePlayerController并在后台播放来自其他应用程序(如spotify)的音频,ios,swift,mpmovieplayercontroller,avaudioplayer,avaudiosession,Ios,Swift,Mpmovieplayercontroller,Avaudioplayer,Avaudiosession,我使用MPMoviePlayerController,我希望用户能够观看包含音频的视频,并能够继续收听他们的Spotify或其他已经在后台运行的音乐应用程序。如何允许我的应用程序播放电影并允许用户继续收听音乐 self.moviePlayer = MPMoviePlayerController(contentURL: url) if var player = self.moviePlayer { // let the preview loo
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)
}
嗨,你有什么解决办法吗?找到了就告诉我。我转到另一个项目,但几年前我对这个项目很感兴趣。