mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-13 16:33:01 -06:00
Radio service improvements
This commit is contained in:
parent
19a80b66e2
commit
f8ecdd811d
|
|
@ -226,6 +226,7 @@ export class AppRadioService implements OnDestroy {
|
||||||
|
|
||||||
this.audioContext.decodeAudioData(arrayBuffer, (buffer) => {
|
this.audioContext.decodeAudioData(arrayBuffer, (buffer) => {
|
||||||
if (this.call.current) {
|
if (this.call.current) {
|
||||||
|
this.audioContext.resume().then(() => {
|
||||||
this.audioSource = this.audioContext.createBufferSource();
|
this.audioSource = this.audioContext.createBufferSource();
|
||||||
|
|
||||||
this.audioSource.buffer = buffer;
|
this.audioSource.buffer = buffer;
|
||||||
|
|
@ -234,10 +235,7 @@ export class AppRadioService implements OnDestroy {
|
||||||
this.audioSource.start();
|
this.audioSource.start();
|
||||||
|
|
||||||
this.audioTimer = setInterval(() => this.emitTimeEvent(), 500);
|
this.audioTimer = setInterval(() => this.emitTimeEvent(), 500);
|
||||||
|
});
|
||||||
if (this.audioContext.state === 'suspended') {
|
|
||||||
this.audioContext.resume();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, () => this.skip());
|
}, () => this.skip());
|
||||||
}
|
}
|
||||||
|
|
@ -326,11 +324,9 @@ export class AppRadioService implements OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
|
this.audioContext.resume().then(() => {
|
||||||
EVENTS.forEach((event) => document.body.removeEventListener(event, bootstrap));
|
EVENTS.forEach((event) => document.body.removeEventListener(event, bootstrap));
|
||||||
|
});
|
||||||
if (this.audioContext.state === 'suspended') {
|
|
||||||
this.audioContext.resume();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue