提交 cf443fa7 编写于 作者: C CodFrm

视频线路记录 & README.md #19

上级 da9c73cd
......@@ -67,14 +67,24 @@ Build->扩展程序->开启开发者模式->加载已解压的扩展程序->目
下载发布版本cxmooc-tools.crx文件,直接拖入浏览器安装
## 说明
PC打开超星慕课课程页面,在视频上方将会显示一个按钮,单击按钮即可直接将视频看完,但是有一定的风险
PC打开超星慕课课程页面,在视频上方将会有按钮显示
开始挂机需要先播放视频后,再点击,还在优化中
**秒过视频**功能可直接将视频看完,但是**有一定的风险**
挂机模式2,还在测试中,不知道有什么样的风险,欢迎反馈,如果能成功,将在全自动挂机迈出一大步^_^
开始挂机(钩为已经实现,空为更新内容):
* [x] 后台挂机
* [x] 视频内题目填充(选择类型的题目,填空的没有案例,未测试)
* [ ] 视频源选择
* [ ] 自动下一集
![](/build/cxmooc-tools/img/soft/soft_01.png)
#### 题库
关于题库,可以访问该页面:[https://github.com/CodFrm/cxmooc-tools/issues/16](https://github.com/CodFrm/cxmooc-tools/issues/16)
不定期的更新题库文件,因为没有自己手动的去收集题目,所以大部分题目**需要有人第一次做过**,后来的人才能搜索到题目
## 其他
如果有兴趣的可以来一起开发,完善功能
......
......@@ -26,22 +26,35 @@ window.monitorPlay = function () {
window.removeOldPlayer = function (obj) {
//移除老的视频对象
console.log(obj);
paras = obj.parentNode.parentNode;
console.log(obj.parentNode.parentNode.removeChild(obj.parentNode));
// <div id="note1-wrap">
// <div id="hl"></div>
// <div id="note1">
// 正在为您加载视频...
// </div>
// </div>
var parent = obj.parentNode.parentNode;
obj.parentNode.parentNode.removeChild(obj.parentNode);
var note = this.document.getElementById('note');
var note1 = document.createElement('div');
note1.id = 'note1-wrap';
note1.innerHTML = '<div id="hl"></div><div id="note1">cxmooc-tools正在为您更换播放器...</div></div>';
document.body.insertBefore(note1, note);
newPlayer();
// obj.setAttribute('data', document.head.getAttribute('url') + 'player/cxmooc-tools.swf?v=' + document.head.getAttribute('v'));
//对线路进行监控和切换
$(parent).bind('onChangeLine', function (h, g) {
//监听线路切换
localStorage['lineIndex'] = g;
});
var timer = setInterval(function () {
var obj = document.querySelector('object');
if (obj != null) {
clearInterval(timer);
//切换上一次记录的线路,如果没有或者为0就不进行切换了
if(localStorage['lineIndex']==undefined || localStorage['lineIndex']==0){
return ;
}
var flashvars=obj.querySelector('[name="flashvars"]').getAttribute('value');
obj.querySelector('[name="flashvars"]').setAttribute(
'value',
flashvars.replace('dftLineIndex%22%3A0%2C%22', 'dftLineIndex%22%3A' + localStorage['lineIndex'] + '%2C%22')
);
obj.setAttribute('data', obj.getAttribute('data'));
}
}, 500);
}
/**
......@@ -88,32 +101,8 @@ window.newPlayer = function () {
data: paras,
height: 540,
width: 676,
playerPath:document.head.getAttribute('url') + 'player/cxmooc-tools.swf?v=' + document.head.getAttribute('v'),
ResourcePlugPath:document.head.getAttribute('url') + 'player/ResourcePlug.swf?v=' + document.head.getAttribute('v'),
});
}
function showHTML5Player(paras) {
loadMultiFile([{
href: 'videoplayer/video-js.css',
tag: 'link',
rel: 'stylesheet'
}, {
src: 'videoplayer/video.js',
tag: 'script',
type: 'text/javascript',
defer: 'defer'
}], function () {
var html = [
'<video id="video" class="video-js vjs-default-skin" controls preload="auto" width="100%" height="100%" poster="{0}" data-setup="{}">',
'<source src="{1}" type="video/mp4">',
'<source src="video.webm" type="video/webm">',
'</video>'
].join('');
html = Ext.String.format(html, paras.screenshot, paras.http);
Ext.get('reader').setHTML(html);
playerPath: document.head.getAttribute('url') + 'player/cxmooc-tools.swf?v=' + document.head.getAttribute('v'),
ResourcePlugPath: document.head.getAttribute('url') + 'player/ResourcePlug.swf?v=' + document.head.getAttribute('v'),
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册