Skip to content

Commit

Permalink
fix(player): Allowed main load method to return a Promise
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa8626 committed Apr 26, 2021
1 parent bfab2a6 commit e627846
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/esm/player.js
Expand Up @@ -145,7 +145,7 @@ class Player {
}
load() {
if (this.isMedia()) {
__classPrivateFieldGet(this, _media).load();
return __classPrivateFieldGet(this, _media).load();
}
}
play() {
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.js
Expand Up @@ -1794,7 +1794,7 @@ var Player = function () {
key: "load",
value: function load() {
if (this.isMedia()) {
__classPrivateFieldGet(this, _media).load();
return __classPrivateFieldGet(this, _media).load();
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/js/player.ts
Expand Up @@ -339,9 +339,9 @@ class Player {
* HLS and M(PEG)-DASH perform more operations during loading if browser does not support them natively.
* @memberof Player
*/
public load(): void {
public load(): Promise<void>|void {
if (this.isMedia()) {
this.#media.load();
return this.#media.load();
}
}

Expand Down
2 changes: 1 addition & 1 deletion types/player.d.ts
Expand Up @@ -92,7 +92,7 @@ declare class Player {
* HLS and M(PEG)-DASH perform more operations during loading if browser does not support them natively.
* @memberof Player
*/
load(): void;
load(): Promise<void> | void;
/**
* Play media.
*
Expand Down

0 comments on commit e627846

Please sign in to comment.