From c0f76bcf0084e085bc5baccd5fc0a1d7781930d1 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Mon, 6 Jul 2015 17:35:04 -0700 Subject: [PATCH] Add fullscreen button --- templates/channel.jade | 2 ++ www/js/ui.js | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/templates/channel.jade b/templates/channel.jade index 128d7933..83edc37c 100644 --- a/templates/channel.jade +++ b/templates/channel.jade @@ -76,6 +76,8 @@ html(lang="en") #videocontrols.btn-group.pull-right button#mediarefresh.btn.btn-sm.btn-default(title="Reload the video player") span.glyphicon.glyphicon-retweet + button#fullscreenbtn.btn.btn-sm.btn-default(title="Make the video player fullscreen") + span.glyphicon.glyphicon-fullscreen button#getplaylist.btn.btn-sm.btn-default(title="Retrieve playlist links") span.glyphicon.glyphicon-link button#voteskip.btn.btn-sm.btn-default(title="Voteskip") diff --git a/www/js/ui.js b/www/js/ui.js index a9d8981f..1bc48136 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -792,3 +792,16 @@ $("#emotelist-alphabetical").change(function () { EMOTELIST.handleChange(); EMOTELIST.loadPage(0); }); + +$("#fullscreenbtn").click(function () { + var elem = document.querySelector("#videowrap .embed-responsive"); + // this shit is why frontend web development sucks + var fn = elem.requestFullscreen || + elem.mozRequestFullScreen || // Mozilla has to be different and use a capital 'S' + elem.webkitRequestFullscreen || + elem.msRequestFullscreen; + + if (fn) { + fn.call(elem); + } +});