diff --git a/lib/dash/dash_parser.js b/lib/dash/dash_parser.js index 5cd6c05d21..c7dfa0c0fe 100644 --- a/lib/dash/dash_parser.js +++ b/lib/dash/dash_parser.js @@ -766,6 +766,14 @@ shaka.dash.DashParser = class { context.adaptationSet = this.createFrame_(elem, context.period, null); + // Filter image adaptation sets, until we add thumbnail track support. + // See: https://github.com/google/shaka-player/issues/559 + const isImage = context.adaptationSet.contentType == ContentType.IMAGE; + if (isImage) { + shaka.log.warning('Skipping Image AdaptationSet', context.adaptationSet); + return null; + } + let main = false; const roleElements = XmlUtils.findChildren(elem, 'Role'); const roleValues = roleElements.map((role) => { diff --git a/lib/util/manifest_parser_utils.js b/lib/util/manifest_parser_utils.js index 62464f86b0..d79323f514 100644 --- a/lib/util/manifest_parser_utils.js +++ b/lib/util/manifest_parser_utils.js @@ -67,6 +67,7 @@ shaka.util.ManifestParserUtils.ContentType = { VIDEO: 'video', AUDIO: 'audio', TEXT: 'text', + IMAGE: 'image', APPLICATION: 'application', }; diff --git a/test/dash/dash_parser_manifest_unit.js b/test/dash/dash_parser_manifest_unit.js index 7e7112302a..afb2e0c75e 100644 --- a/test/dash/dash_parser_manifest_unit.js +++ b/test/dash/dash_parser_manifest_unit.js @@ -1370,4 +1370,34 @@ describe('DashParser Manifest', () => { expect(textStream.roles).toEqual(['captions', 'foo']); expect(textStream.kind).toBe('caption'); }); + + it('Does not error when image adaptation sets are present', async () => { + const manifestText = [ + '', + ' ', + ' ', + ' ', + ' v-sd.mp4', + ' ', + ' ', + ' ', + ' ', + ' ', + ' a-en.mp4', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', + ].join('\n'); + + fakeNetEngine.setResponseText('dummy://foo', manifestText); + + const manifest = await parser.start('dummy://foo', playerInterface); + const variant = manifest.periods[0].variants[0]; + expect(variant.audio).toBeTruthy(); + expect(variant.video).toBeTruthy(); + }); });