Skip to content

Latest commit

 

History

History
289 lines (208 loc) · 11.6 KB

API.md

File metadata and controls

289 lines (208 loc) · 11.6 KB

HLSVod

Kind: global class

new HLSVod(vodManifestUri, splices, timeOffset, startTimeOffset, header, opts)

Create an HLS VOD instance

Param Type Description
vodManifestUri string the uri to the master manifest of the VOD
splices Object an array of ad splice objects
timeOffset number time offset as unix timestamp ms
startTimeOffset number start time offset in N ms from start
header string prepend the m3u8 playlist with this text
opts string other options

hlsVod.defaultAudioGroupAndLang

TODO: Handle case where prevVod and nextVod have many groups and languages, but none of them match. Currently, it only sets a default if there is only one possible group and lang to match with on the prevVod.

Kind: instance property of HLSVod

hlsVod.load()

Load and parse the HLS VOD

Kind: instance method of HLSVod

hlsVod.loadAfter(previousVod)

Load and parse the HLS VOD where the first media sequences contains the end sequences of the previous VOD

Kind: instance method of HLSVod

Param Type Description
previousVod HLSVod the previous VOD to concatenate to

hlsVod.reload(mediaSeqNo, additionalSegments, additionalAudioSegments, insertAfter) ⇒

Removes all segments that come before or after a specified media sequence. Then adds the new additional segments in front or behind. It finally creates new media sequences with the updated collection of segments.

Kind: instance method of HLSVod
Returns: A promise that new Media Sequences have been made

Param Type Description
mediaSeqNo number The media Sequence index that is the live index.
additionalSegments object New group of segments to merge with a possible subset of this.segments
additionalAudioSegments object New group of audio segments to merge with a possible subset of this.segments
insertAfter boolean Whether the additional segments are to be added in front of the live index or behind

hlsVod.addMetadata(key, value)

Add metadata timed for this VOD

Kind: instance method of HLSVod

Param Type Description
key key EXT-X-DATERANGE attribute key
value *

hlsVod.getVodUri()

Retrieve master manifest Uri for this VOD

Kind: instance method of HLSVod

hlsVod.getLiveMediaSequenceSegments(seqIdx)

Get all segments (duration, uri) for a specific media sequence

Kind: instance method of HLSVod

Param Type Description
seqIdx number media sequence index (first is 0)

hlsVod.getLiveAudioSequenceSegments(seqIdx)

Get all audio segments (duration, uri) for a specific media sequence

Kind: instance method of HLSVod

Param Type Description
seqIdx number media sequence index (first is 0)

hlsVod.getMediaSegments()

Get all segments (duration, uri)

Kind: instance method of HLSVod

hlsVod.getLiveMediaSequenceAudioSegments(audioGroupId, audioLanguage, seqIdx)

Get all audio segments (duration, uri) for a specific media sequence based on audio group and lang

Kind: instance method of HLSVod

Param Type Description
audioGroupId string audio group Id
audioLanguage string audio language
seqIdx number media sequence index (first is 0)

hlsVod.getLiveMediaSequenceSubtitleSegments(subtitleGroupId, subtitleLanguage, seqIdx)

Get all subtitle segments (duration, uri) for a specific media sequence

Kind: instance method of HLSVod

Param Type Description
subtitleGroupId string subtitle group Id
subtitleLanguage string subtitle language
seqIdx number media sequence index (first is 0)

hlsVod.getBandwidths()

Get the available bandwidths for this VOD

Kind: instance method of HLSVod

hlsVod.getLiveMediaSequencesCount()

Get the number of media sequences for this VOD

Kind: instance method of HLSVod

hlsVod.getLastSequenceMediaSequenceValue()

Get the media-sequence value for the last media sequence of this VOD

Kind: instance method of HLSVod

hlsVod.getLastSequenceMediaSequenceValueAudio()

Get the media-sequence value for the last audio media sequence of this VOD

Kind: instance method of HLSVod

hlsVod.getLastSequenceMediaSequenceValueSubtitle()

Get the media-sequence value for the last subtitle media sequence of this VOD

Kind: instance method of HLSVod

hlsVod.getLiveMediaSequences(offset, bandwidth, seqIdx, discOffset, padding, forceTargetDuration)

Get the HLS live media sequence for a specific media sequence and bandwidth

Kind: instance method of HLSVod

Param Type Description
offset number add this offset to all media sequences in the EXT-X-MEDIA-SEQUENCE tag
bandwidth string
seqIdx number
discOffset number add this offset to all discontinuity sequences in the EXT-X-DISCONTINUITY-SEQUENCE tag
padding number add extra seconds on the EXT-X-TARGETDURATION
forceTargetDuration number enforce a fixed EXT-X-TARGETDURATION

hlsVod.getLiveMediaAudioSequences()

Gets a hls/makes m3u8-file with all of the correct audio segments belonging to a given groupID & language for a particular sequence.

Kind: instance method of HLSVod

hlsVod.getLiveMediaSubtitleSequences()

Gets a hls/makes m3u8-file with all of the correct subtitle segments belonging to a given groupID & language for a particular sequence.

Kind: instance method of HLSVod

hlsVod.getUsageProfiles()

Get the usage profile for this VOD

Kind: instance method of HLSVod

hlsVod.getLastDiscontinuity()

Get the last discontinuity sequence number

Kind: instance method of HLSVod

hlsVod.getLastDiscontinuityAudio()

Get the last audio discontinuity sequence number

Kind: instance method of HLSVod

hlsVod.getDeltaTimes()

Get the delta times for each media sequence.

Kind: instance method of HLSVod

hlsVod.getPlayheadPositions()

Returns the playhead position for each media sequence

Kind: instance method of HLSVod

hlsVod.releasePreviousVod()

Remove pointers to previous VOD and release to garbage collector

Kind: instance method of HLSVod

hlsVod.getDuration()

Returns the current duration calculated from the sum of the duration of all segments

Kind: instance method of HLSVod

hlsVod.getLastUsedDiscSeq()

Returns the last added Discontinuity sequence count from getLiveMediaSequences()

Kind: instance method of HLSVod

hlsVod._copyAudioGroupsFromPrevious()

Gets previous VOD's audio -groupIds, -langs, -segments from its last sequence and adds them to the current VOD's this.audioSegments property.

Kind: instance method of HLSVod

hlsVod._copySubtitleGroupsFromPrevious()

Gets previous VOD's subtitle -groupIds, -langs, -segments from its last sequence and adds them to the current VOD's this.subtitleSegments property.

Kind: instance method of HLSVod