How to write a script that intercepts a service call?

you could potentially use something like this:

to create a media_player.template which wraps your real media_player but then lets you override the set_volume and do whatever you want with it.