Youtube Hide Control

Automatically hide youtube control bar when paused

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Youtube Hide Control
// @version      0.1
// @namespace    https://github.com/TheFantasticWarrior
// @description  Automatically hide youtube control bar when paused
// @author       TFW
// @match        https://*.youtube.com/watch?v=*
// @grant        none
// ==/UserScript==

(function() {
    var timer;
    document.addEventListener('mousemove', function(){
        if(document.getElementsByClassName("html5-video-player")[0].classList.contains("ytp-autohide")){
        document.getElementsByClassName("html5-video-player")[0].classList.remove("ytp-autohide");
        }
        clearTimeout(timer);
        timer = setTimeout(noAction, 1000);
    });

    function noAction(){
        if(!document.getElementsByClassName("html5-video-player")[0].classList.contains("ytp-autohide")){
        document.getElementsByClassName("html5-video-player")[0].classList.add("ytp-autohide");
        }
    }
})();