In locked mode, when not casting my app adjusts the media volume but it fails to do so while when I'm casting.
Any ideas?
You can look at the CastCompanionLibrary (CCL), in VideoCastManager class, to see how it is doing it (assuming you have tested the CastVideos-android and that is doing it as you expect). Are you using RemoteControlClient (RCC)? One thing to try is to register the RCC instance with the AudioManager:
registerRemoteControlClient(RemoteControlClient rcClient)
If you look into setUpRemoteControl(..)
method in VideoCastManager in the CCL project, you should be able to get it to work. Note that this feature is not available on older versions of Android.