AVPlayer Video Blank but Hear Sound

前端 未结 3 547
小蘑菇
小蘑菇 2021-01-17 10:33

I\'m switching from MPMoviePlayerController to AVPlayer as I need finer grained control over video swapping. The .mov file I was playi

3条回答
  •  有刺的猬
    2021-01-17 11:01

    Make sure you the statement that plays the video:

    [self.player play]
    

    is invoked from main dispatch queue like this (Swift 3):

    DispatchQueue.main.async {
        self.player.play()
    }
    

提交回复
热议问题