-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathAudioMack.bsstrategy
45 lines (45 loc) · 1.08 KB
/
AudioMack.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
41
42
43
44
45
//
// Audiomack.plist
// BeardedSpice
//
// Created by Sean Coker on 08/10/17.
// Copyright (c) 2017 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:2,
displayName:"Audiomack",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*audiomack.com*'",
args: ["URL"]
},
toggle: function () {
window.amPlayer.paused() ? window.amPlayer.play() : window.amPlayer.pause();
},
isPlaying: function () {
return !window.amPlayer.paused();
},
next: function () {
window.amPlayer.next();
},
previous: function () {
window.amPlayer.prev();
},
pause: function () {
window.amPlayer.pause();
},
favorite: function () {
window.amPlayer.favorite();
},
trackInfo: function () {
var info = window.amPlayer.info();
return {
'artist': info.artist,
'album': info.album,
'track': info.title,
'image': info.image,
'progress': info.progress,
'favorited': info.favorited
}
}
}