Copy link to clipboard
Copied
i use Adobe AIR to develop a music player, use SampleDataEvent and FileStream AIR can play flac,wav,aiff,dsf,dff,aifc music files.
air audio decoder has done and it work great well.
but for ios , it can't show music info at ios control center (music part) and cant recive the next / prev pause / play button event at ios control center.
it is a big bug for music player.
can air team add this feature in AIR? just ios is OK.
or give a ANE for this.
thanks.
or open some function to set ios AVAudioSession and get ios control center music control button event.
just ios is OK.
Thanks very much.
i use ANE has done. show in ios music control center and dsp music sample at AIR use SampleDataEvent.
Thanks.
code:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategorySoloAmbient error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
NSString *list = [productIdsString substringFromIndex:1];;
NSArray *listItems = [li
...Copy link to clipboard
Copied
Have you tried the Media Player ANE by distriqt? It looks like it can display music info in the control center and also register for control center events:
Copy link to clipboard
Copied
I need use air sound to output and need use as3 dsp sound.not by apple itself. Sound is better than apple.need use air sound.
Copy link to clipboard
Copied
Yes, but looking at the documentation for the ANE, the control center functionality seems to be separate from the actual media player. You could try using the ane ONLY for the control center code and use your own player code, ignoring the media player code in the ANE if you only want access to control center.
Copy link to clipboard
Copied
i use ANE has done. show in ios music control center and dsp music sample at AIR use SampleDataEvent.
Thanks.
code:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategorySoloAmbient error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
NSString *list = [productIdsString substringFromIndex:1];;
NSArray *listItems = [list componentsSeparatedByString:@"<ori>"];
NSMutableDictionary *songDict=[NSMutableDictionary dictionary];
NSString *tmpTitleStr = listItems[0];
//歌名
[songDict setObject:tmpTitleStr forKey:MPMediaItemPropertyTitle];
//歌手名
[songDict setObject:listItems[1] forKey:MPMediaItemPropertyArtist];
//歌曲的总时间
NSString *tmpTimeStr = listItems[2];
[songDict setObject:[NSNumber numberWithDouble:[tmpTimeStr doubleValue]] forKeyedSubscript:MPMediaItemPropertyPlaybackDuration];
//设置歌曲图片
// MPMediaItemArtwork *imageItem=[[MPMediaItemArtwork alloc]initWithImage:nil];
// [songDict setObject:imageItem forKey:MPMediaItemPropertyArtwork];
//设置控制中心歌曲信息
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songDict];