-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCoursera.bsstrategy
40 lines (40 loc) · 1.14 KB
/
Coursera.bsstrategy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// Odnoklassniki.plist
// BeardedSpice
//
// Created by Andrei Glingeanu on 7/29/15.
// Copyright (c) 2015 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:1,
displayName:"Coursera",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*coursera.org*'",
args: ["URL"]
},
isPlaying: function () {
var v = vjs(document.querySelectorAll('.video-js')[0].querySelector('video').id);
return ! v.paused();
},
toggle: function () {
var v = vjs(document.querySelectorAll('.video-js')[0].querySelector('video').id);
if (v.paused()) {
v.play();
} else {
v.pause();
}
},
next: function () {return document.querySelectorAll('.c-item-side-nav-right .c-block-icon-link')[0].click()},
previous: function () {return document.querySelectorAll('.c-item-side-nav-left .c-block-icon-link')[0].click()},
pause: function () {
var v = vjs(document.querySelectorAll('.video-js')[0].querySelector('video').id);
v.pause();
},
trackInfo: function () {
return {
'track': document.querySelector('.c-video-title').firstChild.nodeValue,
'artist': 'Coursera'
}
}
}