@@ -53,19 +53,20 @@ const (
53
53
54
54
// Known error variables
55
55
var (
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" )
69
70
)
70
71
71
72
type MPD struct {
@@ -124,7 +125,7 @@ type CommonAttributesAndElements struct {
124
125
ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"`
125
126
EssentialProperty []DescriptorType `xml:"EssentialProperty,omitempty"`
126
127
SupplementalProperty []DescriptorType `xml:"SupplementalProperty,omitempty"`
127
- InbandEventStream * DescriptorType `xml:"inbandEventStream,attr "`
128
+ InbandEventStream [] DescriptorType `xml:"InbandEventStream,omitempty "`
128
129
}
129
130
130
131
type contentProtections []ContentProtectioner
@@ -1101,6 +1102,21 @@ func (as *AdaptationSet) AddNewAccessibilityElement(scheme AccessibilityElementS
1101
1102
return accessibility , nil
1102
1103
}
1103
1104
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
+
1104
1120
// Sets the BaseURL for a Representation.
1105
1121
// baseURL - Base URL as a string (i.e. 800k/output-audio-und.mp4)
1106
1122
func (r * Representation ) SetNewBaseURL (baseURL string ) error {
@@ -1166,3 +1182,18 @@ func (r *Representation) setAudioChannelConfiguration(acc *AudioChannelConfigura
1166
1182
r .AudioChannelConfiguration = acc
1167
1183
return nil
1168
1184
}
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