Last active
April 22, 2022 08:47
-
-
Save ahmet-cetinkaya/50782d593330abc1514cc86a210a8db4 to your computer and use it in GitHub Desktop.
Skip Silence Audio and Video Sync Fix - Tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Skip Silence Sync Fix | |
// @namespace ahmetcetinkaya.me | |
// @version 1.0.2 | |
// @description Fixing audio and video sync. | |
// @author ahmetcetinkaya <ahmetcetinkaya7@outlook.com> | |
// @match *://*.youtube.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const getVideo = () => document.querySelector('video'); | |
const isRunningSkipSilence = () => !!document.querySelector('.skip-silence-bar-collapsed'); | |
let video; | |
const syncAudioAndVideo = () => { | |
if(!isRunningSkipSilence()) return; | |
if(!video) video = getVideo(); | |
video.currentTime = video.currentTime; | |
console.log('🐛 Skip Silence Sync Fix'); | |
} | |
setInterval(syncAudioAndVideo, 30000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment