Skip to content

Commit

Permalink
Removed flag that prevented play to work as expected with preload="no…
Browse files Browse the repository at this point in the history
…ne"; fixes #403
  • Loading branch information
rafa8626 committed Jan 12, 2024
1 parent 2013179 commit 3a397a4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion dist/esm/media.js
Expand Up @@ -90,7 +90,6 @@ class Media {
play() {
return __awaiter(this, void 0, void 0, function* () {
if (!__classPrivateFieldGet(this, _Media_mediaLoaded, "f")) {
__classPrivateFieldSet(this, _Media_mediaLoaded, true, "f");
yield this.load();
__classPrivateFieldSet(this, _Media_mediaLoaded, false, "f");
}
Expand Down
17 changes: 8 additions & 9 deletions dist/openplayer.js
Expand Up @@ -4766,23 +4766,22 @@ var Media = function () {
switch (_context2.prev = _context2.next) {
case 0:
if (media_classPrivateFieldGet(this, _Media_mediaLoaded, "f")) {
_context2.next = 7;
_context2.next = 6;
break;
}
media_classPrivateFieldSet(this, _Media_mediaLoaded, true, "f");
_context2.next = 4;
_context2.next = 3;
return this.load();
case 4:
case 3:
media_classPrivateFieldSet(this, _Media_mediaLoaded, false, "f");
_context2.next = 9;
_context2.next = 8;
break;
case 7:
_context2.next = 9;
case 6:
_context2.next = 8;
return media_classPrivateFieldGet(this, _Media_media, "f").promise;
case 9:
case 8:
media_classPrivateFieldSet(this, _Media_promisePlay, media_classPrivateFieldGet(this, _Media_media, "f").play(), "f");
return _context2.abrupt("return", media_classPrivateFieldGet(this, _Media_promisePlay, "f"));
case 11:
case 10:
case "end":
return _context2.stop();
}
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/openplayer.min.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/js/media.ts
Expand Up @@ -90,7 +90,6 @@ class Media {
// @see https://developers.google.com/web/updates/2017/06/play-request-was-interrupted
async play(): Promise<void> {
if (!this.#mediaLoaded) {
this.#mediaLoaded = true;
await this.load();
this.#mediaLoaded = false;
} else {
Expand Down

0 comments on commit 3a397a4

Please sign in to comment.