Skip to content

Commit

Permalink
#92 Adding support to hide icon on Youtube Full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikabu committed May 18, 2020
1 parent 01e7a1d commit 1785426
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions base/pratikabu-stt.js
Expand Up @@ -523,6 +523,18 @@ var pratikabustt = {

return otherImagesSize;
},

videoFullScreenChangeEvent: function() {
var elem = $("#pratikabuSTTDiv");
!document.fullscreenElement ? elem.show() : elem.hide();
},

registerFullScreenListener: function() {
document.addEventListener("fullscreenchange", pratikabustt.videoFullScreenChangeEvent, false);
document.addEventListener("msfullscreenchange", pratikabustt.videoFullScreenChangeEvent, false);
document.addEventListener("mozfullscreenchange", pratikabustt.videoFullScreenChangeEvent, false);
document.addEventListener("webkitfullscreenchange", pratikabustt.videoFullScreenChangeEvent, false);
},

loadFromResponse: function(response) {// load the images, css, include/remove elements
pratikabu_stt_prefs = response;
Expand Down Expand Up @@ -579,6 +591,8 @@ var pratikabustt = {
pratikabu_stt_autoHide = true;
$(window).scroll(pratikabustt.scrollHandlerAutoHide);
}

pratikabustt.registerFullScreenListener();
} else {
if("hideattop" === pratikabu_stt_prefs.visibilityBehav) {
$(window).unbind('scroll', pratikabustt.scrollHandlerHideAtTop);
Expand Down

0 comments on commit 1785426

Please sign in to comment.