CLICK TO PAUSE/PLAY

Userscript that enables pause/play on click for kick.com

21.12.2023 itibariyledir. En son verisyonu görün.

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        CLICK TO PAUSE/PLAY
    // @description Userscript that enables pause/play on click for kick.com
    // @version     4.0
    // @grant       none
    // @author      Trilla_G
    // @include     https://kick.com/*
    // @namespace https://greasyfork.org/en/users/1200587-trilla-g
    // @license MIT
    // ==/UserScript==
     
    (function() {
        document.addEventListener("click", clickHandler, false);
     
        function clickHandler(e) {
            // Check if the click is on the video element
            let player = getPlayer();
            if (!player || e.target !== player) {
                return;
            }
     
            // Prevent default action and toggle play/pause
            e.preventDefault();
            if (player.paused) {
                player.play();
            } else {
                player.pause();
            }
        }
     
        function getPlayer() {
            var possibleVideo = document.querySelector('.vjs-tech');
            if (!possibleVideo || possibleVideo.nodeName !== "VIDEO") {
                return null;
            }
            return possibleVideo;
        }
    })();