better video player

video tag

// ==UserScript==
// @name         better video player
// @namespace    http://tampermonkey.net/
// @version      1
// @description  video tag
// @author       some random
// @match        *://*/*
// @icon         idk
// @grant        none
// ==/UserScript==


let el=document.createElement("style");
el.innerHTML="\n* {\n object-fit: fill !important;\n}\n@media (min-aspect-ratio: 16/9) {\n * > video { height: 300%; top: -100%; }\n}\n@media (max-aspect-ratio: 16/9) {\n * > video { width: 300%; left: -100%; }\n}\n",
top.document.head.append(el),
document.querySelectorAll("video").forEach((e=>{
    e.onplay=function(){this.requestFullscreen()},
    e.addEventListener("fullscreenchange",
        (function(n){null!==document.fullscreenElement||e.pause()})
    )}
));