开发者

iOS Background Audio Icon

开发者 https://www.devze.com 2023-01-31 17:55 出处:网络
I\'ve followed the API Docs and WWDC Videos exactly, to play audio in the background via an Audio开发者_开发知识库 Session (using the AudioQueue services). It all works just fine, but there is no \"Pl

I've followed the API Docs and WWDC Videos exactly, to play audio in the background via an Audio开发者_开发知识库 Session (using the AudioQueue services). It all works just fine, but there is no "Play" indicator displayed in the Status Bar.

Do i have to set this separately or is it a Bug?


I think this was done by the Audio Session:

// before instantiating the playback audio queue object, 
//  set the audio session category
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty (
                         kAudioSessionProperty_AudioCategory,
                         sizeof (sessionCategory),
                         &sessionCategory
                         );

// activate the audio session immmediately before playback starts
AudioSessionSetActive (true);
0

精彩评论

暂无评论...
验证码 换一张
取 消