Is there a way to keep youtube videos etc playing even while closing the lid?
For YouTube you would need to subscribe to YouTube Music Key. This allows you to 


  play music on mobile the way you want to – with or without video, while using other apps or with your screen off.


It also removes adverts from music videos and allows you to download &amp; play videos offline.

I'm not aware of how to achieve this with other apps (which don't support playing in the background).