This is not an exact solution, but you can try:
When playing a video file, set its volume to 0.
At the same time, use a service in which you can play any sound you want.
How the service works in the background, it does not affect streaming video.
When your video ends, end your service.
And do not forget to set the volume of the audio file.
source share