Keep sound from video playing in background
I personally use MX Player, and it does what you say very well. It has support for locked screen audio playback, background play of audio from videos, pop-up videos and others. Downside is that the free version is ad-supported. Also, it needs a plugin for DTS/AC3 audio.

The background play setting is not enabled by default, and has to be enabled by the user, however, the background playback of audio is enabled by default.

Click images to enlarge

The background play notification:



The background audio playback setting: