TikTok Video Seek Control

right arrow key (→) to forward the video 3 seconds and left arrow key (←) to rewind the video 3 seconds

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

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

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.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

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!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

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

// ==UserScript==
// @name        TikTok Video Seek Control
// @namespace   Violentmonkey Scripts
// @match       https://www.tiktok.com/*/video/*
// @match       https://www.tiktok.com/
// @grant       none
// @version     1.1
// @author      3xploiton3
// @description right arrow key (→) to forward the video 3 seconds and left arrow key (←) to rewind the video 3 seconds
// @license      MPL-2.0
// ==/UserScript==

(function () {
    'use strict';

    // Fungsi untuk mencari video yang sedang diputar
    function getActiveVideo() {
        // TikTok biasanya hanya menampilkan satu video pada satu waktu
        const videos = document.querySelectorAll('video');
        for (const video of videos) {
            if (!video.paused || video.readyState > 2) {
                return video;
            }
        }
        return null;
    }

    // Tambahkan event listener untuk tombol keyboard
    document.addEventListener('keydown', function (e) {
        const video = getActiveVideo();
        if (!video) return;

        // Panah kanan → untuk maju 3 detik
        if (e.key === 'ArrowRight') {
            video.currentTime += 3;
            e.preventDefault(); // Hindari scroll horizontal
        }

        // Panah kiri ← untuk mundur 3 detik
        else if (e.key === 'ArrowLeft') {
            video.currentTime -= 3;
            e.preventDefault();
        }
    }, true);
})();