function toggleScreenDetection() {
        const autoToggle = playerInstance.displayOptions.layoutControls.miniPlayer.autoToggle;

        if (toggleByVisibilityControl || !autoToggle) {
            document.removeEventListener('scroll', toggleMiniPlayerByVisibility);
            return;
        }

        toggleByVisibilityControl = true;
        document.addEventListener('scroll', toggleMiniPlayerByVisibility, { passive: true });
    }
Toggles auto toggle for mini player