0

hello i trying to play streaming video in background

when i played streaming audio file by AVPlayer

i set the Audio, Airpay, picture in Picture Option of Background modes Capabilities

and set this code at AppDelegate

do {
    try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
    try AVAudioSession.sharedInstance().setActive(true)
} catch let sessionError {
    print(sessionError)
}

application.beginReceivingRemoteControlEvents()

Audio was fine but video won't play

I use AVPlayer not AVPlayerViewController for custom playback control

How can i play streaming video in background

PrepareFor
  • 2,448
  • 6
  • 22
  • 36
  • @matt may be youtube? Does youtube provide video and audio together for background play? – PrepareFor Apr 10 '18 at 14:06
  • Thanks but what is this questions and answers https://stackoverflow.com/questions/15425968/play-video-in-background-using-avplayer – PrepareFor Apr 10 '18 at 14:18

0 Answers0