You might want to look into catt for Chromecast:
- https://github.com/skorokithakis/catt/
But I'm not aware of what the equivalent would be for Amazon-type casting
I wrote a wrapper around catt for playing music to my house speaker-groups. It also works with video but I don't cast video as often so that part might be buggy--in that case better to use catt directly