diff --git a/src/lib/viewers/media/DashViewer.js b/src/lib/viewers/media/DashViewer.js index 89f7a9f34..9de1b77f0 100644 --- a/src/lib/viewers/media/DashViewer.js +++ b/src/lib/viewers/media/DashViewer.js @@ -406,7 +406,10 @@ class DashViewer extends VideoBaseViewer { const error = new PreviewError( ERROR_CODE.SHAKA, __('error_refresh'), - {}, + { + code: normalizedShakaError.code, + severity: normalizedShakaError.severity + }, `Shaka error. Code = ${normalizedShakaError.code}, Category = ${ normalizedShakaError.category }, Severity = ${normalizedShakaError.severity}, Data = ${normalizedShakaError.data.toString()}` diff --git a/src/lib/viewers/media/__tests__/DashViewer-test.js b/src/lib/viewers/media/__tests__/DashViewer-test.js index 2969bf3c3..4876e0962 100644 --- a/src/lib/viewers/media/__tests__/DashViewer-test.js +++ b/src/lib/viewers/media/__tests__/DashViewer-test.js @@ -547,6 +547,8 @@ describe('lib/viewers/media/DashViewer', () => { const [event, error] = dash.emit.getCall(0).args; expect(event).to.equal('error'); expect(error).to.be.instanceof(PreviewError); + expect(error.details.code).to.equal(shakaError.detail.code); + expect(error.details.severity).to.equal(shakaError.detail.severity); expect(error.code).to.equal('error_shaka'); });