Skip to content

Commit

Permalink
Fix AdaptationSetSwitching support
Browse files Browse the repository at this point in the history
We had a typo in the case of an attribute (schemeIdUri vs schemeIdURI)
and we did not have support for the latest scheme URI (upcoming MPEG
scheme URI vs /guidelines/ vs /descriptor/).

Change-Id: Ibee1802cfe2b04183d52e75378fa23e0c4e3aae8
  • Loading branch information
joeyparrish committed Oct 11, 2016
1 parent 7a2bd03 commit 696332f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,10 @@ shaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) {
XmlUtils.findChildren(elem, 'SupplementalProperty');
var switchableIds = [];
supplementalProperties.forEach(function(prop) {
var schemeId = prop.getAttribute('schemeIdURI');
if (schemeId == 'http://dashif.org/descriptor/AdaptationSetSwitching') {
var schemeId = prop.getAttribute('schemeIdUri');
if (schemeId == 'urn:mpeg:dash:adaptation-set-switching:2016' ||
schemeId == 'http://dashif.org/guidelines/AdaptationSetSwitching' ||
schemeId == 'http://dashif.org/descriptor/AdaptationSetSwitching') {
var value = prop.getAttribute('value');
if (value)
switchableIds.push.apply(switchableIds, value.split(','));
Expand Down
6 changes: 3 additions & 3 deletions test/dash/dash_parser_content_protection_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ describe('DashParser.ContentProtection', function() {
]);
});

it('squashs encrypted sets in same group', function(done) {
it('squashes encrypted sets in same group', function(done) {
var source = [
'<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011"',
' xmlns:cenc="urn:mpeg:cenc:2013">',
' <Period duration="PT30S">',
' <SegmentTemplate media="s.mp4" duration="2" />',
' <AdaptationSet mimeType="video/mp4" id="1">',
' <SupplementalProperty value="2"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching" />',
'schemeIdUri="http://dashif.org/guidelines/AdaptationSetSwitching" />',
' <ContentProtection',
' schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />',
' <ContentProtection',
Expand All @@ -205,7 +205,7 @@ describe('DashParser.ContentProtection', function() {
' </AdaptationSet>',
' <AdaptationSet mimeType="video/mp4" id="2">',
' <SupplementalProperty value="1"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching" />',
'schemeIdUri="http://dashif.org/descriptor/AdaptationSetSwitching" />',
' <ContentProtection',
' schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />',
' <ContentProtection',
Expand Down
12 changes: 6 additions & 6 deletions test/dash/dash_parser_manifest_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('DashParser.Manifest', function() {
[
' <AdaptationSet id="1" mimeType="video/mp4" lang="en">',
' <SupplementalProperty value="2"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="http://dashif.org/guidelines/AdaptationSetSwitching"/>',
' <Representation bandwidth="100" />',
' </AdaptationSet>',
' <AdaptationSet id="2" mimeType="video/mp4" lang="en">',
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('DashParser.Manifest', function() {
[
' <AdaptationSet mimeType="video/mp4" lang="en" id="1">',
' <SupplementalProperty value="4"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
' <Representation bandwidth="100" />',
' </AdaptationSet>',
' <AdaptationSet mimeType="video/mp4" lang="en" id="2">',
Expand Down Expand Up @@ -239,12 +239,12 @@ describe('DashParser.Manifest', function() {
[
' <AdaptationSet mimeType="video/mp4" lang="en" id="1">',
' <SupplementalProperty value="2"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016"/>',
' <Representation bandwidth="100" />',
' </AdaptationSet>',
' <AdaptationSet mimeType="video/mp4" lang="es" id="2">',
' <SupplementalProperty value="1"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="http://dashif.org/guidelines/AdaptationSetSwitching"/>',
' <Representation bandwidth="200" />',
' </AdaptationSet>',
' </Period>',
Expand Down Expand Up @@ -273,12 +273,12 @@ describe('DashParser.Manifest', function() {
[
' <AdaptationSet mimeType="video/mp4" lang="en" id="1">',
' <SupplementalProperty value="2"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
' <Representation bandwidth="100" />',
' </AdaptationSet>',
' <AdaptationSet mimeType="audio/mp4" lang="en" id="2">',
' <SupplementalProperty value="1"',
'schemeIdURI="http://dashif.org/descriptor/AdaptationSetSwitching"/>',
'schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016"/>',
' <Representation bandwidth="200" />',
' </AdaptationSet>',
' </Period>',
Expand Down

0 comments on commit 696332f

Please sign in to comment.