Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cherenkov/102693 to your computer and use it in GitHub Desktop.
Save cherenkov/102693 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name NicoVideoAutoPlay
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
// http://d.hatena.ne.jp/javascripter/20081003/1223033435
function evalInPage(fun) {
location.href = "javascript:void (" + fun + ")()";
}
evalInPage(function play() {
var flvplayer = $("flvplayer");
try {
if (flvplayer.ext_getStatus() == "paused")
flvplayer.ext_play(1);
else
setTimeout(play, 500);
} catch(e) {
setTimeout(play, 500);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment