Htc phones have fastboot.
When you switch off your device, the phone does not actually shut down. It hibernates. It goes to a low power mode. The kernel is still active.
This is why htc boots quite fast, in less than 6secs.
And That is why alarm works even after it is switched off. In samsung, this is not possible as the phone is completely turned off.
As for youtube, i saw an app pvstar which played videos in background. Other than that i have no idea.