Skip to content

Commit

Permalink
Merge pull request #33 from bvc3at/support_label_attribute
Browse files Browse the repository at this point in the history
Support non-standard label attribute
  • Loading branch information
sangwonl authored Oct 15, 2019
2 parents a7844c9 + fb4b925 commit ca75790
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mpegdash/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def __init__(self):
self.id = None # xs:unsignedInt
self.group = None # xs:unsignedInt
self.lang = None # xs:language
self.label = None # xs:string
self.content_type = None # xs:string
self.par = None # RatioType
self.min_bandwidth = None # xs:unsignedInt
Expand Down Expand Up @@ -553,6 +554,7 @@ def parse(self, xmlnode):
self.id = parse_attr_value(xmlnode, 'id', int)
self.group = parse_attr_value(xmlnode, 'group', int)
self.lang = parse_attr_value(xmlnode, 'lang', str)
self.label = parse_attr_value(xmlnode, 'label', str)
self.content_type = parse_attr_value(xmlnode, 'contentType', str)
self.par = parse_attr_value(xmlnode, 'par', str)
self.min_bandwidth = parse_attr_value(xmlnode, 'minBandwidth', int)
Expand Down Expand Up @@ -585,6 +587,7 @@ def write(self, xmlnode):
write_attr_value(xmlnode, 'id', self.id)
write_attr_value(xmlnode, 'group', self.group)
write_attr_value(xmlnode, 'lang', self.lang)
write_attr_value(xmlnode, 'label', self.label)
write_attr_value(xmlnode, 'contentType', self.content_type)
write_attr_value(xmlnode, 'par', self.par)
write_attr_value(xmlnode, 'minBandwidth', self.min_bandwidth)
Expand Down
1 change: 1 addition & 0 deletions mpegdash/schema/dash-mpd.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<xs:attribute name="id" type="xs:unsignedInt"/>
<xs:attribute name="group" type="xs:unsignedInt"/>
<xs:attribute name="lang" type="xs:language"/>
<xs:attribute name="label" type="xs:string" />
<xs:attribute name="contentType" type="xs:string"/>
<xs:attribute name="par" type="RatioType"/>
<xs:attribute name="minBandwidth" type="xs:unsignedInt"/>
Expand Down
2 changes: 1 addition & 1 deletion tests/mpd-samples/sample-001.mpd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</Representation>
</AdaptationSet>
<!-- Just the audio -->
<AdaptationSet mimeType="audio/mp2t">
<AdaptationSet mimeType="audio/mp2t" lang="eng" label="English">
<BaseURL>audio/</BaseURL>
<!-- We're just going to offer one audio representation, since audio bandwidth isn't very
important. -->
Expand Down

0 comments on commit ca75790

Please sign in to comment.