A Simple Demo using the page visibility API. Page Visibility API is a really nice addition to HTML5 that can really improve the user experience specially for audio, video and gaming. Hope to experiment with it a lot more in future.