How to allow system sleep even playing video?



I’m currently developing TweetDeck client (similar to Tweeten or Tweetduck) using Electron.

when Tweetdeck plays GIF (actually it’s a HTML5 ), my pc won’t sleep on inactivity (manual sleep has no problem). It’s also happen with chromium browser.

Is there a way to enable sleep regardless playing video?