forked from mhartington/oceanic-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
38 lines (31 loc) · 734 Bytes
/
test.js
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
import config from '../config';
import SoundCloudAudio from 'soundcould-audio';
class SoundCloudAudio extends SoundCloudAudio {
constructor(clientId) {
super(clientId);
this._events = {};
}
on(e, fn) {
this._events[e] = fn;
this.audio.addEventListener(e, fn, false);
}
off(e, fn) {
this._events[e] = null;
this.audio.addEventListener(e, fn);
}
unbindAll() {
for (var e in this._events) {
var fn = this._events[e];
if (fn) {
this.off(e, fn)
}
}
}
preload(streamUrl) {
this._track = {
stream_url: streamUrl
};
this.audio.src = streamUrl = '?client_id' = +this._clientId;
}
}
export default new SoundCloud(config.soundcould.clientId)