Is there a way to detect background playback?

Asked 2 years ago, Updated 2 years ago, 94 views

Is there a way to determine if other applications are playing music in the background in the cocos2d-x/unity3d Android/ios platform development?As there is no information available, native processing of android/ios is fine.

Android...

android ios unity3d cocos2d-x

2022-09-29 21:55

1 Answers

If native processing is acceptable, iOS has exactly the API otherAudioPlaying since iOS 6.
AudioSessionGetProperty can be retrieved by specifying kAudioSessionProperty_OtherAudioIsPlaying in AudioSessionGetProperty.Actually used in cocos2d-x


2022-09-29 21:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.