diff --git a/index.d.ts b/index.d.ts index 2c738d4fdf..c66e68c3c3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1846,7 +1846,7 @@ declare namespace dashjs { export interface PlaybackErrorEvent extends Event { type: MediaPlayerEvents['PLAYBACK_ERROR']; - error: string; + error: MediaError; } export interface PlaybackPausedEvent extends Event { @@ -4462,4 +4462,3 @@ declare namespace dashjs { export type ResponseFilter = (response: LicenseResponse) => Promise; } - diff --git a/test/unit/streaming.controllers.PlaybackControllers.js b/test/unit/streaming.controllers.PlaybackControllers.js index 1944e92709..d46ba70b9c 100644 --- a/test/unit/streaming.controllers.PlaybackControllers.js +++ b/test/unit/streaming.controllers.PlaybackControllers.js @@ -402,12 +402,12 @@ describe('PlaybackController', function () { let onError = function (e) { eventBus.off(Events.PLAYBACK_ERROR, onError); - expect(e.error).to.equal('error'); + expect(e.error.message).to.equal('error'); done(); }; eventBus.on(Events.PLAYBACK_ERROR, onError, this); - videoModelMock.fireEvent('error', [{ target: { error: 'error' } }]); + videoModelMock.fireEvent('error', [{ target: { error: { code: 3, message: 'error' } } }]); }); it('should handle stalled event', function (done) {