I think with a combination of the Tasker App and VLC media player you can accomplish this. Assuming you're on Android and are able to figure out tasker. It's extremely powerful but the UI is pure garbage.
Another idea...Porting VLCthing - #5 by jimvb