Swift 3 - AVPlayer - 同时播放声音文件和视频

时间:2016-11-13 21:57:33

标签: swift swift3 avplayer

我有一个视频,效果很好。

let AVPlayerVC = AVPlayerViewController()

func setupCustomPlayer() {

    AVPlayerVC.view.frame = self.view.frame
    AVPlayerVC.view.sizeToFit()
    AVPlayerVC.showsPlaybackControls = false
    self.view.addSubview(AVPlayerVC.view)

    let videoURL = NSURL(string: "http://videourl")


    let player = AVPlayer(url: videoURL! as URL)
    AVPlayerVC.player = player
    AVPlayerVC.player?.play() 
}

播放视频时,我可以使用AV播放器播放声音文件(mysoundfile.m4p)吗?如果没有,那么替代解决方案是什么。

0 个答案:

没有答案