fixed race condition that could cause two episodes to play simultaneously
This commit is contained in:
parent
5e14db0db0
commit
319d09708e
|
@ -120,6 +120,8 @@ var Player = /** @class */ (function () {
|
||||||
return [4 /*yield*/, res.json()];
|
return [4 /*yield*/, res.json()];
|
||||||
case 1:
|
case 1:
|
||||||
link = _a.sent();
|
link = _a.sent();
|
||||||
|
if (this.howl)
|
||||||
|
this.howl.unload();
|
||||||
this.howl = new Howl({
|
this.howl = new Howl({
|
||||||
src: "".concat(link.url, "?Authorization=").concat(link.token),
|
src: "".concat(link.url, "?Authorization=").concat(link.token),
|
||||||
html5: true,
|
html5: true,
|
||||||
|
|
|
@ -126,6 +126,7 @@ class Player {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const link = <UrlResponse>await res.json();
|
const link = <UrlResponse>await res.json();
|
||||||
|
if (this.howl) this.howl.unload();
|
||||||
this.howl = new Howl({
|
this.howl = new Howl({
|
||||||
src: `${link.url}?Authorization=${link.token}`,
|
src: `${link.url}?Authorization=${link.token}`,
|
||||||
html5: true,
|
html5: true,
|
||||||
|
|
Loading…
Reference in New Issue