The lock screen utilizes a RemoteController, which allows you to listen to any apps that publish music controls via a RemoteControlClient.
Note that RemoteController
was only made public in Android 4.4 and is not available prior to that. Unfortunately, there is no standardized broadcasts that fulfill this same role.