The YouTube app, which is installed on the Samsung Galaxy S5, can play all videos, but it is for pure music listening unsuitable. Because if you want to listen to music on YouTube, it usually makes little sense that the display remains lit all the time. But in the YouTube app, it is the case that when you turn off the display the music is stopped. The YouTube app on the Samsung Galaxy S5 is thus conceivable ill-suited for the pure music listening. However, for that reason there is a good app available:
This app is called: PVSTAR + (YouTube Music Player)
The player can be downloaded for free from the Amazon App Store. After installation, you can now easily search for music. This is accessed for example on YouTube. It is also possible to create own playlists. If you now start playing the music, you can turn off the display of the Samsung Galaxy S5 normally without stopping the music.
So you can now listen to YouTube music, without the music stops when you turn off the display.