App just in Notifications visible sending remote media button keystrokes

Try a foreground service

Read the complete thread and try the several examples you can find there to learn how to work with the extension

Then try to put some blocks together using the extension for your task

And if you got stuck, then ask in the itoo thread and provide a screenshot of what you tried there

Taifun