I have a mac mini, which is connected to a TV using HDMI cable. TV & mini are connected to separate power source, so that I can shutdown TV and mini independently as required.

Primary use of mini is a media center and i watch lot of online videos over it.

The problem is sometime, if i switch off the TV, online videos continue to play in the computer and thus consuming bandwidth. So i'm looking for a way to shutdown (close my video player application etc.) mini if the TV display goes off.