海外用户观看B站视频, 可使用mini播放器, 降低画质以减少流量.
将此链接BliBli-mini加入收藏夹, 在视频页面点击收藏链接执行脚本即可.
源码:
(function (){
var url = location.href;
url = url.split('/');
var aid = '';
var page = '1';
for (var i=0;i<url.length;i++) {
if (0 == url[i].search('av'))
aid = url[i].substr(2);
if (0 == url[i].search('index_'))
page = url[i].substr(6, 1)
}
/*height='356' width='440'*/
var template='<div style="height:100%; width:100%; position:fixed; top:0; left:0; z-index:1000;"> \
<center> \
<embed height="640" width="860" style="visibility:visible; margin-top:5%; margin-bottom:10px;" pluginspage="http://get.adobe.com/cn/flashplayer/" flashvars="playMovie=true&auto=1" allowfullscreen="true" quality="high" src="http://static.hdslb.com/miniloader.swf?aid={{aid}}&page={{page}}" type="application/x-shockwave-flash" wmode="transparent" title="Adobe Flash Player"> \
<br/> \
<input id="bili-hide" style="margin:auto auto; width:6em; height:2.5em;" type="button" value="close"/> \
</center> \
<div style="height:100%; width:100%; background-color:#000000; position:fixed; top:0; left:0; opacity:0.8; z-index:-1;"> \
</div> \
</div>';
template=template.replace('{{aid}}', aid);
template=template.replace('{{page}}', page);
var div = document.createElement('div');
div.setAttribute('id', 'bili-mini');
div.innerHTML = template;
document.body.appendChild(div);
var hide = function() {
var node = document.getElementById("bili-mini");
if (null == node)
return; document.body.removeChild(node);
};
var button = document.getElementById('bili-hide');
if (button)
button.onclick = hide;
})();