Versions in this module Expand all Collapse all v3 v3.0.3 Jun 8, 2021 Changes in this version + const CENC_XMLNS + const CONTENT_PROTECTION_PLAYREADY_SCHEME_HEX + const CONTENT_PROTECTION_PLAYREADY_SCHEME_ID + const CONTENT_PROTECTION_PLAYREADY_SCHEME_V10_HEX + const CONTENT_PROTECTION_PLAYREADY_SCHEME_V10_ID + const CONTENT_PROTECTION_PLAYREADY_XMLNS + const CONTENT_PROTECTION_ROOT_SCHEME_ID_URI + const CONTENT_PROTECTION_ROOT_VALUE + const CONTENT_PROTECTION_WIDEVINE_SCHEME_HEX + const CONTENT_PROTECTION_WIDEVINE_SCHEME_ID + const DASH_CONTENT_TYPE_IMAGE + const DASH_MIME_TYPE_AUDIO_MP4 + const DASH_MIME_TYPE_IMAGE_JPEG + const DASH_MIME_TYPE_SUBTITLE_DFXP + const DASH_MIME_TYPE_SUBTITLE_SRT + const DASH_MIME_TYPE_SUBTITLE_TTML + const DASH_MIME_TYPE_SUBTITLE_VTT + const DASH_MIME_TYPE_VIDEO_MP4 + var ErrAccessibilityNil = errors.New("Accessibility nil") + var ErrAdaptationSetNil = errors.New("Adaptation Set nil") + var ErrAudioChannelConfigurationNil = errors.New("Audio Channel Configuration nil") + var ErrBaseURLEmpty = errors.New("Base URL empty") + var ErrContentProtectionNil = errors.New("Content Protection nil") + var ErrInvalidDefaultKID = errors.New("Invalid Default KID string, should be 32 characters") + var ErrNoDASHProfileSet error = errors.New("No DASH profile set") + var ErrPROEmpty = errors.New("PlayReady PRO empty") + var ErrRepresentationNil = errors.New("Representation nil") + var ErrSegmentBaseNil = errors.New("Segment Base nil") + var ErrSegmentBaseOnDemandProfileOnly = errors.New("Segment Base can only be used with On-Demand Profile") + var ErrSegmentTemplateLiveProfileOnly = errors.New("Segment template can only be used with Live Profile") + var ErrSegmentTemplateNil = errors.New("Segment Template nil ") + func ParseDuration(str string) (time.Duration, error) + type Accessibility struct + AdaptationSet *AdaptationSet + SchemeIdUri *string + Value *string + type AccessibilityElementScheme string + const ACCESSIBILITY_ELEMENT_SCHEME_DESCRIPTIVE_AUDIO + type AdaptationSet struct + AccessibilityElems []*Accessibility + ContentType *string + Group *string + ID *string + Lang *string + MaxBandwidth *string + MaxHeight *string + MaxWidth *string + MinBandwidth *string + MinHeight *string + MinWidth *string + PAR *string + Representations []*Representation + Roles []*Role + SegmentAlignment *bool + SegmentBase *SegmentBase + SegmentList *SegmentList + SegmentTemplate *SegmentTemplate + XMLName xml.Name + func (as *AdaptationSet) AddContentProtection(cp ContentProtectioner) error + func (as *AdaptationSet) AddNewAccessibilityElement(scheme AccessibilityElementScheme, val string) (*Accessibility, error) + func (as *AdaptationSet) AddNewContentProtectionRoot(defaultKIDHex string) (*CENCContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionRootLegacyUUID(defaultKIDHex string) (*CENCContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemePlayready(pro string) (*PlayreadyContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemePlayreadyV10(pro string) (*PlayreadyContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemePlayreadyV10WithPSSH(pro string) (*PlayreadyContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemePlayreadyWithPSSH(pro string) (*PlayreadyContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemeWidevine() (*WidevineContentProtection, error) + func (as *AdaptationSet) AddNewContentProtectionSchemeWidevineWithPSSH(wvHeader []byte) (*WidevineContentProtection, error) + func (as *AdaptationSet) AddNewRepresentationAudio(samplingRate int64, bandwidth int64, codecs string, id string) (*Representation, error) + func (as *AdaptationSet) AddNewRepresentationSubtitle(bandwidth int64, id string) (*Representation, error) + func (as *AdaptationSet) AddNewRepresentationThumbnails(id, val, uri string, bandwidth, width, height int64) (*Representation, error) + func (as *AdaptationSet) AddNewRepresentationVideo(bandwidth int64, codecs string, id string, frameRate string, width int64, ...) (*Representation, error) + func (as *AdaptationSet) AddNewRole(schemeIDURI string, value string) (*Role, error) + func (as *AdaptationSet) SetNewSegmentTemplate(duration int64, init string, media string, startNumber int64, timescale int64) (*SegmentTemplate, error) + func (as *AdaptationSet) SetNewSegmentTemplateThumbnails(duration int64, media string, startNumber int64, timescale int64) (*SegmentTemplate, error) + func (as *AdaptationSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type AttrMPD interface + GetStrptr func() *string + func AttrAvailabilityStartTime(value string) AttrMPD + func AttrMediaPresentationDuration(value string) AttrMPD + func AttrMinimumUpdatePeriod(value string) AttrMPD + type AudioChannelConfiguration struct + SchemeIDURI *string + Value *string + type AudioChannelConfigurationScheme string + const AUDIO_CHANNEL_CONFIGURATION_MPEG_DASH + const AUDIO_CHANNEL_CONFIGURATION_MPEG_DOLBY + type CENCContentProtection struct + DefaultKID *string + Value *string + func (s CENCContentProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type CENCContentProtectionMarshal struct + DefaultKID *string + Value *string + type CommonAttributesAndElements struct + AudioChannelConfiguration []DescriptorType + AudioSamplingRate *string + Codecs *string + ContentProtection []ContentProtectioner + EssentialProperty []DescriptorType + FramePacking []DescriptorType + FrameRate *string + Height *string + InbandEventStream *DescriptorType + MaxPlayoutRate *string + MaximumSAPPeriod *string + MimeType *string + Profiles *string + Sar *string + ScanType *string + SegmentProfiles *string + StartWithSAP *int64 + SupplementalProperty []DescriptorType + Width *string + type ContentProtection struct + AdaptationSet *AdaptationSet + Attrs []*xml.Attr + SchemeIDURI *string + XMLNS *string + XMLName xml.Name + func (s ContentProtection) ContentProtected() + func (s ContentProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type ContentProtectionMarshal struct + AdaptationSet *AdaptationSet + Attrs []*xml.Attr + SchemeIDURI *string + XMLNS *string + XMLName xml.Name + type ContentProtectioner interface + ContentProtected func() + type DashProfile string + const DASH_PROFILE_HBBTV_1_5_LIVE + const DASH_PROFILE_LIVE + const DASH_PROFILE_ONDEMAND + type DescriptorType struct + ID *string + SchemeIDURI *string + Value *string + type Duration time.Duration + func (d *Duration) String() string + func (d *Duration) UnmarshalXMLAttr(attr xml.Attr) error + func (d Duration) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + type Event struct + Duration *uint64 + ID *string + PresentationTime *uint64 + XMLName xml.Name + type EventStream struct + Events []Event + SchemeIDURI *string + Timescale *uint + Value *string + XMLName xml.Name + type MPD struct + AvailabilityStartTime *string + BaseURL []string + Location string + MediaPresentationDuration *string + MinBufferTime *string + MinimumUpdatePeriod *string + Periods []*Period + Profiles *string + PublishTime *string + SuggestedPresentationDelay *Duration + TimeShiftBufferDepth *string + Type *string + UTCTiming *DescriptorType + XMLNs *string + func NewDynamicMPD(profile DashProfile, availabilityStartTime, minBufferTime string, ...) *MPD + func NewMPD(profile DashProfile, mediaPresentationDuration, minBufferTime string, ...) *MPD + func Read(r io.Reader) (*MPD, error) + func ReadFromFile(path string) (*MPD, error) + func ReadFromString(xmlStr string) (*MPD, error) + func (m *MPD) AddNewAdaptationSetAudio(mimeType string, segmentAlignment bool, startWithSAP int64, lang string) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetAudioWithID(id string, mimeType string, segmentAlignment bool, startWithSAP int64, ...) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetSubtitle(mimeType string, lang string) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetSubtitleWithID(id string, mimeType string, lang string) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetThumbnails(mimeType string) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetThumbnailsWithID(id, mimeType string) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetVideo(mimeType string, scanType string, segmentAlignment bool, startWithSAP int64) (*AdaptationSet, error) + func (m *MPD) AddNewAdaptationSetVideoWithID(id string, mimeType string, scanType string, segmentAlignment bool, ...) (*AdaptationSet, error) + func (m *MPD) AddNewPeriod() *Period + func (m *MPD) GetCurrentPeriod() *Period + func (m *MPD) Validate() error + func (m *MPD) Write(w io.Writer) error + func (m *MPD) WriteToFile(path string) error + func (m *MPD) WriteToString() (string, error) + type MultipleSegmentBase struct + BitstreamSwitching *URL + Duration *uint32 + SegmentTimeline *SegmentTimeline + StartNumber *uint32 + type Period struct + AdaptationSets []*AdaptationSet + BaseURL string + Duration Duration + EventStreams []EventStream + ID string + SegmentBase *SegmentBase + SegmentList *SegmentList + SegmentTemplate *SegmentTemplate + Start *Duration + func (period *Period) AddNewAdaptationSetAudio(mimeType string, segmentAlignment bool, startWithSAP int64, lang string) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetAudioWithID(id string, mimeType string, segmentAlignment bool, startWithSAP int64, ...) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetSubtitle(mimeType string, lang string) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetSubtitleWithID(id string, mimeType string, lang string) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetThumbnails(mimeType string) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetThumbnailsWithID(id, mimeType string) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetVideo(mimeType string, scanType string, segmentAlignment bool, startWithSAP int64) (*AdaptationSet, error) + func (period *Period) AddNewAdaptationSetVideoWithID(id string, mimeType string, scanType string, segmentAlignment bool, ...) (*AdaptationSet, error) + func (period *Period) SetDuration(d time.Duration) + type PlayreadyContentProtection struct + PRO *string + PSSH *string + PlayreadyXMLNS *string + func (s PlayreadyContentProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type PlayreadyContentProtectionMarshal struct + PRO *string + PSSH *string + PlayreadyXMLNS *string + type Representation struct + AdaptationSet *AdaptationSet + AudioChannelConfiguration *AudioChannelConfiguration + AudioSamplingRate *int64 + Bandwidth *int64 + BaseURL *string + Codecs *string + FrameRate *string + Height *int64 + ID *string + SegmentBase *SegmentBase + SegmentList *SegmentList + SegmentTemplate *SegmentTemplate + Width *int64 + func (r *Representation) AddNewAudioChannelConfiguration(scheme AudioChannelConfigurationScheme, channelConfiguration string) (*AudioChannelConfiguration, error) + func (r *Representation) AddNewSegmentBase(indexRange string, initRange string) (*SegmentBase, error) + func (r *Representation) SetNewBaseURL(baseURL string) error + type Role struct + AdaptationSet *AdaptationSet + SchemeIDURI *string + Value *string + type SegmentBase struct + AvailabilityTimeComplete *bool + AvailabilityTimeOffset *float32 + IndexRange *string + IndexRangeExact *bool + Initialization *URL + PresentationTimeOffset *uint64 + RepresentationIndex *URL + Timescale *uint32 + type SegmentList struct + SegmentURLs []*SegmentURL + type SegmentTemplate struct + AdaptationSet *AdaptationSet + Duration *int64 + Initialization *string + Media *string + PresentationTimeOffset *uint64 + SegmentTimeline *SegmentTimeline + StartNumber *int64 + Timescale *int64 + type SegmentTimeline struct + Segments []*SegmentTimelineSegment + type SegmentTimelineSegment struct + Duration uint64 + RepeatCount *int + StartTime *uint64 + type SegmentURL struct + Index *string + IndexRange *string + Media *string + MediaRange *string + type URL struct + Range *string + SourceURL *string + type WidevineContentProtection struct + PSSH *string + func NewWidevineContentProtection(wvHeader []byte) (*WidevineContentProtection, error) + func (s WidevineContentProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type WidevineContentProtectionMarshal struct + PSSH *string