ニコニコ動画の動画の比率を固定するGreasemonkeyスクリプト
動画のサイズによって4:3、16:9と自動で変わってしまい
固定できないので作ってみた。
一つ前のスクリプトの副産物。
// ==UserScript== // @name Nicovideo Set Aspect Ratio // @namespace http://d.hatena.ne.jp/kiyo_hoge/ // @include http://www.nicovideo.jp/watch/* // ==/UserScript== (function() { const VIDEO_SIZE_WIDE = true; var flvplayer = document.getElementById('flvplayer'); function refreshVideo() { flvplayer.style.display = 'none'; setTimeout(function() { flvplayer.style.display = ''; }, 0); } if (!flvplayer) { return; } var flashvars = flvplayer.getAttribute('flashvars'); var isWide = (flashvars.indexOf('isWide=1') >= 0); if (VIDEO_SIZE_WIDE && !isWide) { flvplayer.setAttribute('flashvars', flashvars + '&isWide=1'); refreshVideo(); } if (!VIDEO_SIZE_WIDE && isWide) { flvplayer.setAttribute('flashvars', flashvars.replace(/(?:^|&)isWide=[^&]+/g, '')); refreshVideo(); } })();
VIDEO_SIZE_WIDE = false
にすれば4:3固定。