Youtube Embed Skip Buttons Mod

Skip buttons for embeded youtube iframes.

30.10.2022 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.

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 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            Youtube Embed Skip Buttons Mod
// @namespace       userscript
// @include         *.youtube.com/embed/*
// @include         *.youtube-nocookie.com/embed/*
// @version         2017.8.22
// @description     Skip buttons for embeded youtube iframes.
// @author          copypastetada ttbbzz
// @homepageURL     https://greatest.deepsurf.us/en/users/2617
// @grant       none
// ==/UserScript==

document.addEventListener("DOMContentLoaded",function(){
	function seekVDO(interval){
		interval += Math.floor(vdo_player.getCurrentTime());
		vdo_player.seekTo(interval);
	}
	var vdo_player = document.querySelector(".html5-video-player"),
		skip_buttons = [{text:"-5s",interval:-5},
						{text:"+5s",interval:5},
						{text:"+15s",interval:15}];
	var timer0 = setInterval(function(){
		if(vdo_player) {
			skip_container = document.querySelector('.ytp-left-controls');
			check_existing_skipbtn = document.querySelector('.skip');
			if (!check_existing_skipbtn && skip_container) {
				skip_buttons.forEach(function(b){ 
					sb = document.createElement('button');
					sb.setAttribute('class', 'ytp-button skip');
					sb.addEventListener('click',function(){seekVDO(b.interval)});
					sb.innerHTML = '<span>'+b.text+'</span>';
					sb.style.verticalAlign = "top";
					sb.style.textAlign = "center";
					skip_container.appendChild(sb);
				});
			} else { console.log("%cplayer control div.ytp-left-controls not found","color:maroon;"); }
			clearInterval(timer0);
		} else {
			console.log("%clooking for div.html5-video-player","color:teal;");
			vdo_player = document.querySelector(".html5-video-player");
		}
	},100);
},false);