This trick only works in YouTube's new player, which is only available for videos that don't include annotations or ads. It's limited to the videos played on YouTube's site and it doesn't work for embedded videos. Here's an example of video you can use to play Snake.
YouTube is not the only Google product that lets you play games. Gmail has a Labs feature called "old Snakey" that adds a Snake game inside Gmail.