If you just want the volume buttons to always control media volume, there's an app for that. 'Rocker Locker' is frequently recommended. Samsung SoundAssistant can also enable this behavior, among other things.
Rocker Locker drains battery since it has to be persistent. Samsung SoundAssistant is only available on Galaxy devices, it isn't compatible with the Pixel.