Created
March 17, 2016 03:54
-
-
Save dotspencer/b443a6289f47a64f6afd to your computer and use it in GitHub Desktop.
Youtube Auto-stopper Shortcode
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 Youtube Stopper | |
// @namespace http://spencerlarry.com/ | |
// @version 0.1 | |
// @description Automatically stops the video before it gets to the end and shows suggested videos. | |
// @author You | |
// @match https://www.youtube.com/watch?v=z_CfRxf3kPI&enablejsapi=1 | |
// @include http*://www.youtube.com/watch?* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
// Your code here... | |
var ytplayer = document.getElementById("movie_player"); | |
window.setInterval(function(){ | |
var ytplayer = document.getElementById("movie_player"); | |
if(ytplayer.getDuration() - ytplayer.getCurrentTime() <= 1.0 ){ | |
ytplayer.pauseVideo(); | |
} | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doesnt work