mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-16 09:53:01 -06:00
Minor improvements to radio.service
This commit is contained in:
parent
73bb1d670d
commit
446f8c9502
|
|
@ -236,20 +236,10 @@ export class AppRadioService implements OnDestroy {
|
||||||
this.audioTimer = setInterval(() => this.emitTimeEvent(), 500);
|
this.audioTimer = setInterval(() => this.emitTimeEvent(), 500);
|
||||||
|
|
||||||
if (this.audioContext.state === 'suspended') {
|
if (this.audioContext.state === 'suspended') {
|
||||||
const resume = () => {
|
|
||||||
this.audioContext.resume();
|
this.audioContext.resume();
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
if (this.audioContext.state === 'running') {
|
|
||||||
EVENTS.forEach((event) => document.body.removeEventListener(event, resume));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
EVENTS.forEach((event) => document.body.addEventListener(event, resume));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, () => this.skip(true));
|
}, () => this.skip());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -333,13 +323,15 @@ export class AppRadioService implements OnDestroy {
|
||||||
} else {
|
} else {
|
||||||
this.audioContext = new AudioContext();
|
this.audioContext = new AudioContext();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.audioContext && this.audioContext.state === 'suspended') {
|
if (this.audioContext) {
|
||||||
|
EVENTS.forEach((event) => document.body.removeEventListener(event, bootstrap));
|
||||||
|
|
||||||
|
if (this.audioContext.state === 'suspended') {
|
||||||
this.audioContext.resume();
|
this.audioContext.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EVENTS.forEach((event) => document.body.removeEventListener(event, bootstrap));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
EVENTS.forEach((event) => document.body.addEventListener(event, bootstrap));
|
EVENTS.forEach((event) => document.body.addEventListener(event, bootstrap));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue