JS code for //docs.brightcove.com/en/video-cloud/smart-player-api/samples/are-you-watching.html