AVAudioPlayer is not playing in Background when iPhone is locked

前端 未结 4 2029
花落未央
花落未央 2021-01-03 11:57

Actually i fetching the songs from Documents Directory.

I referred this Link:- http://www.raywenderlich.com/29948/backgrounding-for-ios , But it wil

4条回答
  •  耶瑟儿~
    2021-01-03 12:30

    Are there other audio/video apps currently running on your device? Some of them that also use AVAudioSessionCategoryPlayback can interrupt your audio session.

    How it is said on Apple Developer:

    By default, using this category implies that your app’s audio is nonmixable—activating your session will interrupt any other audio sessions which are also nonmixable. To allow mixing for this category, use the AVAudioSessionCategoryOptionMixWithOthers option.

提交回复
热议问题