actionscript 3 - How to detect if music is playing on iOS in AIR app -
i've seen native call test if music playing via music app on ios, i'm having trouble discovering if there's native as3 call or ane can same? have game it's own music, i'd automatically disable music if player has music playing.
will necessary create custom ane (i don't know if exist 1 feature). believe quite simple. try follow these steps
- include avfoundation framework
- import: #import
- create method check. follow example
freobject ismusicplaying(frecontext ctx, void* funcdata, uint32_t argc, freobject argv[]) {
bool retunvalue;
avaudioplayer *audioplayer; returnvalue = (audioplayer.playing) ? yes : no;
freobject retstr = null; frenewobjectfrombool(returnvalue, retstr);
return retstr;
}
Comments
Post a Comment