A problem with the div size of the Youtube video

I’ve temporarily solved the problem this way

// ==UserScript==
// @name         Lingq youtube sentens vidio size fix
// @namespace    http://tampermonkey.net/
// @version      2024-04-16
// @description  try to take over the world!
// @author       You
// @match        *://www.lingq.com/*/learn/de/web/reader/*
// @match        *://www.lingq.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function checkVideoSection() {
        const videoWrapper = document.getElementById('sentence-video-player-portal');
        if (!videoWrapper) return;

        const firstChild = videoWrapper.querySelector('div');
        if (firstChild && firstChild.classList.contains('video-section')) {
            var videoWrapperDivs = document.querySelector('.sentence--video-player.video-wrapper').getElementsByTagName('div');
            if(videoWrapperDivs.length > 1) {
                videoWrapperDivs[1].style.height = '300px';
            }
            console.log('yes');
        } else {
            console.log('no');
        }
    }

    // Run the check every second
    setInterval(checkVideoSection, 1000);
})();
1 Like

Thanks, we will look into this.

1 Like