Greasy Fork is available in English.

Kick.com Mouse audio controls

Kick.com Mouse audio controls (middle click: mute | scroll: adjust volume)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Kick.com Mouse audio controls
// @namespace    Sky3
// @version      1.0
// @description  Kick.com Mouse audio controls (middle click: mute | scroll: adjust volume)
// @author       Sky3
// @match        https://kick.com/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let prevScrollDate = 0;

    function addHandlers() {
        const videoElement = document.getElementById('video-player');
        videoElement.addEventListener('mousedown', (event) => {
          if (event.button == 1) {
              videoElement.muted = !videoElement.muted;
              event.preventDefault();
              event.stopPropagation();
          }
        });

        videoElement.addEventListener('wheel', (event) => {
            if (videoElement.muted) return;

            event.preventDefault();
            event.stopPropagation();

            const shouldIncrease = event.deltaY < 0;
            const volume = videoElement.volume;

            if ((volume == 0 && !shouldIncrease) || (volume == 1 && shouldIncrease)) return;

            const now = Date.now(), since = now - prevScrollDate
            const step = (shouldIncrease ? 1 : -1) * (since < 50 ? 4 : 1) * .01

            videoElement.volume += step;

            prevScrollDate = now
        });
    }

    setTimeout(() => {
        addHandlers();
    }, 2000);
})();