Skip to content

Instantly share code, notes, and snippets.

@ahmet-cetinkaya
Last active April 22, 2022 08:47
Show Gist options
  • Save ahmet-cetinkaya/50782d593330abc1514cc86a210a8db4 to your computer and use it in GitHub Desktop.
Save ahmet-cetinkaya/50782d593330abc1514cc86a210a8db4 to your computer and use it in GitHub Desktop.
Skip Silence Audio and Video Sync Fix - Tampermonkey
// ==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