"neowinston" wrote:
audioPlayer = CreateObject("roAudioPlayer")
port = CreateObject("roMessagePort")
port = CreateObject("roUniversalControlEvent") ' <-- wrong '
audioPlayer.SetMessagePort(port) ' <-- should have err'ed on wrong argument
This is not how you do it. The next line should have caused runtime error, trying to set message port into audioPlayer that is NOT a roMessagePort - but SDK APIs notoriously lax on type checking.
The way it works is the component you have on screen, be it roSpringboardScreen, roListScreen, roPosterScreen etc - it will send a ro...Event to its assigned port, which will respond with True to .isRemoteKeyPressed(). And then you can call .pause()/.resume() on the roAudioPlayer().