There is a node.js wrapper for bluetoothctl - https://www.npmjs.com/package/bluetoothctl
So if you are using node.js on your pi, you can do some magic with it and run what you want on bluetooth device connect.
I`m using desktop and it`s all fine with playing music from my android phone, no difference from pc - oxygen 4.1
but it is unlistenable if you are using an Android phone