斗鱼TV开启CDN加速

斗鱼TV开启CDN加速,提升画质,减少卡顿

< Feedback on 斗鱼TV开启CDN加速

Question/comment

§
Posted:
Edited:

这脚本效率低了点,我改了一下,只有10行代码

"use strict";
let rm = $('#WebRoom');
if (rm.size()) rm.ready(function(){
    let c = rm[0].children,
    s = c.flashvars.value,
    cdn = get_url_param('cdn') || ['ws','lx','ws2','dl'][~~(Math.random() * 4)];
    c.wmode.value = 'gpu';
    c.flashvars.value = s.replace(/&cdn=\w*/, `&cdn=${cdn}`);
    rm.toggle().toggle();
});
§
Posted:
还可加入cookie记住选择的CDN
§
Posted:
  1. 建议储存到 LocalStorage
  2. 代码请使用 ``` 包含。例如:

``` 我的代码 ```

我的代码
§
Posted:
@JixunMoe 很勤快啊!!很少用Markdown
马上改
上CSDN学学Markdown

Post reply

Sign in to post a reply.