Skip to content

Commit

Permalink
fix(esl-media): postpone BrightcoveProvider ready state notification …
Browse files Browse the repository at this point in the history
…until metadata is available
  • Loading branch information
NastaLeo committed Feb 3, 2025
1 parent 62e67c1 commit e3d4159
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/esl-media/providers/brightcove-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export class BrightcoveProvider extends BaseProvider {
this._api.on('play', () => this.component._onPlay());
this._api.on('pause', () => this.component._onPaused());
this._api.on('ended', () => this.component._onEnded());
this.component._onReady();

// Can handle query only when loadedmetadata have happened
return this.$$fromEvent('loadedmetadata');
Expand All @@ -112,7 +111,7 @@ export class BrightcoveProvider extends BaseProvider {
this._ready = Provider.loadAPI(this._account)
.then(() => this.onAPILoaded())
.then(() => this.onAPIReady())
.catch((e) => this.component._onError(e));
.then(() => this.component._onReady(), (e) => this.component._onError(e));
}

public override unbind(): void {
Expand Down

0 comments on commit e3d4159

Please sign in to comment.