Can i turn mac off and keep video going?

I was wondering if there was a way to close my laptop with a youtube video going but the sound/video still plays? Like so if i want to listen to music and close my laptop? Could i do this with my iPhone too somehow?

There's an apps like InsomniaX or nosleep.

Closing the lid is not "off". It is sleep. You have several options to prevent the notebook sleeping when you don't want to look at the open lid…

To disable sleep, Install InsomniaX or "NoSleep", links below…
or…
Connect an external display and keyboard. Then the computer knows you can use it with the lid closed, so it will not go to sleep from closing the lid.
or…
Put a deck of cards on the trackpad, so when you close the lid, it stays partly open.

CAUTION:
Closed lid holds in heat. Movies cause much more heat than other uses of the system. Playing movies with the lid closed will probably make the computer age faster, due to excess heat.

  • Will iPhone 4 keep recording video if it automatically goes off? I want to use my iPhone 4 as a dash camera. My question is, do I need to set it so that the backlight doesn't come on, that is, so that it doesn't turn off automatically? In other words, will my phone keep recording video if it turns off automatically?
  • My iphone turn off for no reason and won't turn back on and lock button is broken? I was just on it and it was 85% charge and it turn off for no reason and it still vibrating.plus my lock button is broken I need help Mom won't take me to get it fix I need help now
  • How to keep my iPhone 5 from going to sleep when a video is being played? My iPhone 5 is running the latest version of iOS 7. Lately, I've been noticing that when I'm following a workout video, it goes to sleep after a while. This has never happened to me before, and I've had this phone for more than a year. It's very annoying when your phone just goes to sleep when you're trying to workout. I use apps to workout, but it's not just one particular app that this has been occurring in. Can someone please tell me how to fix this please?
  • Can you turn off the glowing apple logo on a mac? I like it, but I'm not really the type who likes to show off. I bought the computer for professional uses, and because it's in sync with my iPhone, not to show off. It's the latest 13 inch macbook pro with retina display.