Skip to content

Instantly share code, notes, and snippets.

@bernardobarreto
Forked from hltbra/udacity_ext.js
Created May 16, 2012 04:15
Show Gist options
  • Save bernardobarreto/2707337 to your computer and use it in GitHub Desktop.
Save bernardobarreto/2707337 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Udacity EXT - Auto next video&quiz
// @description Udacity Extension -- Automatically go to the next video or quiz question upon reaching the end of the current one
// @namespace http://sepczuk.com/
// @version 0.2
// @include http://www.udacity.com/view*
// @match http://www.udacity.com/view*
// @copyright 2012, Damian Sepczuk, Hugo Lopes Tavares // Bernardo B. Marques
// ==/UserScript==
function main(){
if (window.App.player === undefined) {
setTimeout(main, 300);
return;
}
App.player.addEventListener('onStateChange', function(p) {
if (p.data === YT.PlayerState.ENDED) {
$('#course-next-button').click();
}
});
}
if (!document.xmlVersion) {
var script = $('<script>').
append('(' + main + ')();');
$('head').append(script);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment