Skip to content

Commit

Permalink
fix(FEC-11513): Need to click the Retry button twice after error (#485)
Browse files Browse the repository at this point in the history
Issue :the reset logic is not called in the first press since the _reset stat flag is true
fix: rest the _reset state to false every time error occur by listening to all error events dispatched from the player
  • Loading branch information
JonathanTGold authored Sep 2, 2021
1 parent 5dddcd6 commit 84406e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,11 @@ class KalturaPlayer extends FakeEventTarget {
}
});
}
this._eventManager.listen(this, CoreEventType.ERROR, (event: FakeEvent) => {
if (event.payload.severity === Error.Severity.CRITICAL) {
this._reset = false;
}
});
}

_onChangeSourceEnded(): void {
Expand Down
8 changes: 8 additions & 0 deletions test/src/kaltura-player.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ describe('kaltura player api', function () {
kalturaPlayer.loadMedia({entryId}, {poster});
});

it('the reset stat should be false whenever an error occurs', function (done) {
kalturaPlayer._reset.should.be.true;
kalturaPlayer.loadMedia({}).catch(() => {
kalturaPlayer._reset.should.be.false;
done();
});
});

describe('maybeSetStreamPriority', function () {
describe('media source mime type is video/youtube', function () {
it('should add youtube to stream priority if not already set', function (done) {
Expand Down

0 comments on commit 84406e9

Please sign in to comment.