Vraylle / Display video controls on hover

// ==UserScript==
// @name        Display video controls on hover
// @namespace   tag:URI
// @description Show HTML5 video controls on hover (includes dynamically loaded content)
// @include     *
// @version     1.1
// @grant       none
// @updateURL   https://openuserjs.org/meta/Vraylle/Display_video_controls_on_hover.meta.js
// ==/UserScript==

(function() {
    function live (eventType, cb) {
        document.addEventListener(eventType, function (event) {
            var el = event.target, found;
            
            while (el && !(found = el.tagName.toLowerCase() == 'video')) {
                el = el.parentElement;
            }

            if (found) {
                cb.call(el, event);
            }
        });
    }

    live("mouseover", function (event) {
        //console.log("Showing controls");
        this.setAttribute("controls", "true");
    });
    live("mouseout", function (event) {
        //console.log("Hiding controls");
        this.removeAttribute("controls", "false");
    });
})();