@@ -53,19 +53,20 @@ const (
5353
5454// Known error variables
5555var (
56- ErrNoDASHProfileSet error = errors .New ("No DASH profile set" )
57- ErrAdaptationSetNil = errors .New ("Adaptation Set nil" )
58- ErrSegmentTemplateLiveProfileOnly = errors .New ("Segment template can only be used with Live Profile" )
59- ErrSegmentTemplateNil = errors .New ("Segment Template nil " )
60- ErrRepresentationNil = errors .New ("Representation nil" )
61- ErrAccessibilityNil = errors .New ("Accessibility nil" )
62- ErrBaseURLEmpty = errors .New ("Base URL empty" )
63- ErrSegmentBaseOnDemandProfileOnly = errors .New ("Segment Base can only be used with On-Demand Profile" )
64- ErrSegmentBaseNil = errors .New ("Segment Base nil" )
65- ErrAudioChannelConfigurationNil = errors .New ("Audio Channel Configuration nil" )
66- ErrInvalidDefaultKID = errors .New ("Invalid Default KID string, should be 32 characters" )
67- ErrPROEmpty = errors .New ("PlayReady PRO empty" )
68- ErrContentProtectionNil = errors .New ("Content Protection nil" )
56+ ErrNoDASHProfileSet error = errors .New ("No DASH profile set" )
57+ ErrAdaptationSetNil = errors .New ("Adaptation Set nil" )
58+ ErrSegmentTemplateLiveProfileOnly = errors .New ("Segment template can only be used with Live Profile" )
59+ ErrSegmentTemplateNil = errors .New ("Segment Template nil " )
60+ ErrRepresentationNil = errors .New ("Representation nil" )
61+ ErrAccessibilityNil = errors .New ("Accessibility nil" )
62+ ErrBaseURLEmpty = errors .New ("Base URL empty" )
63+ ErrSegmentBaseOnDemandProfileOnly = errors .New ("Segment Base can only be used with On-Demand Profile" )
64+ ErrSegmentBaseNil = errors .New ("Segment Base nil" )
65+ ErrAudioChannelConfigurationNil = errors .New ("Audio Channel Configuration nil" )
66+ ErrInvalidDefaultKID = errors .New ("Invalid Default KID string, should be 32 characters" )
67+ ErrPROEmpty = errors .New ("PlayReady PRO empty" )
68+ ErrContentProtectionNil = errors .New ("Content Protection nil" )
69+ ErrInbandEventStreamSchemeUriEmpty = errors .New ("Inband Event Stream schemeIdUri Empty" )
6970)
7071
7172type MPD struct {
@@ -124,7 +125,7 @@ type CommonAttributesAndElements struct {
124125 ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"`
125126 EssentialProperty []DescriptorType `xml:"EssentialProperty,omitempty"`
126127 SupplementalProperty []DescriptorType `xml:"SupplementalProperty,omitempty"`
127- InbandEventStream * DescriptorType `xml:"inbandEventStream,attr "`
128+ InbandEventStream [] DescriptorType `xml:"InbandEventStream,omitempty "`
128129}
129130
130131type contentProtections []ContentProtectioner
@@ -1101,6 +1102,21 @@ func (as *AdaptationSet) AddNewAccessibilityElement(scheme AccessibilityElementS
11011102 return accessibility , nil
11021103}
11031104
1105+ // AddNewInbandEventStream - Adds a new InbandEventStream Descriptor to an adaptation set
1106+ // uri - Scheme ID URI for the inband event stream
1107+ // val - value for inband event stream
1108+ func (as * AdaptationSet ) AddNewInbandEventStream (uri string , val string ) error {
1109+ if len (uri ) <= 0 {
1110+ return ErrInbandEventStreamSchemeUriEmpty
1111+ }
1112+ evt := DescriptorType {
1113+ SchemeIDURI : Strptr (uri ),
1114+ Value : Strptr (val ),
1115+ }
1116+ as .InbandEventStream = append (as .InbandEventStream , evt )
1117+ return nil
1118+ }
1119+
11041120// Sets the BaseURL for a Representation.
11051121// baseURL - Base URL as a string (i.e. 800k/output-audio-und.mp4)
11061122func (r * Representation ) SetNewBaseURL (baseURL string ) error {
@@ -1166,3 +1182,18 @@ func (r *Representation) setAudioChannelConfiguration(acc *AudioChannelConfigura
11661182 r .AudioChannelConfiguration = acc
11671183 return nil
11681184}
1185+
1186+ // AddNewInbandEventStream - Adds a new InbandEventStream Descriptor to a Representation
1187+ // uri - Scheme ID URI for the inband event stream
1188+ // val - value for inband event stream
1189+ func (r * Representation ) AddNewInbandEventStream (uri string , val string ) error {
1190+ if len (uri ) <= 0 {
1191+ return ErrInbandEventStreamSchemeUriEmpty
1192+ }
1193+ evt := DescriptorType {
1194+ SchemeIDURI : Strptr (uri ),
1195+ Value : Strptr (val ),
1196+ }
1197+ r .InbandEventStream = append (r .InbandEventStream , evt )
1198+ return nil
1199+ }
0 commit comments