fixed race condition that could cause two episodes to play simultaneously

This commit is contained in:
Rudis Muiznieks 2023-04-29 09:31:28 -05:00
parent 5e14db0db0
commit 319d09708e
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
2 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,8 @@ var Player = /** @class */ (function () {
return [4 /*yield*/, res.json()];
case 1:
link = _a.sent();
if (this.howl)
this.howl.unload();
this.howl = new Howl({
src: "".concat(link.url, "?Authorization=").concat(link.token),
html5: true,

View File

@ -126,6 +126,7 @@ class Player {
return;
}
const link = <UrlResponse>await res.json();
if (this.howl) this.howl.unload();
this.howl = new Howl({
src: `${link.url}?Authorization=${link.token}`,
html5: true,