Created
August 2, 2016 20:04
-
-
Save ethanbeyer/787d326b8e4b24d43061cf54729f58c3 to your computer and use it in GitHub Desktop.
Open Current YouTube in same tab as embed (so it's full screen)
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
javascript:(function(){ | |
var video_id = window.location.search.split("v=")[1]; | |
var ampersandPosition = video_id.indexOf("&"); | |
var ytplayer = document.getElementById("movie_player"); | |
var $time = ytplayer.getCurrentTime(); | |
$time = Math.round($time); | |
if(ampersandPosition != -1) { | |
video_id = video_id.substring(0, ampersandPosition); | |
} | |
window.location.assign("http://youtube.com/embed/" + video_id + "?autoplay=1&start=" + $time); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment