Documentation ¶
Index ¶
Constants ¶
const EndListPrefix = "#EXT-X-ENDLIST"
const HeaderPrefix = "#EXTM3U"
const ManifestSuffix = ".m3u8"
const MediaSequencePrefix = "#EXT-X-MEDIA-SEQUENCE:"
const TSInfoPrefix = "#EXTINF:"
const TSSuffix = ".ts"
const TargetDurationPrefix = "#EXT-X-TARGETDURATION:"
const VariantPrefix = "#EXT-X-STREAM-INF:"
const VersionPrefix = "#EXT-X-VERSION:"
Variables ¶
This section is empty.
Functions ¶
func GetLiveMediaSequence ¶
GetLiveMediaSequence gets the live media sequence, from the vod m3u8. That is, if vod has 3 TSes each 2 seconds long, and offset is 3s, this returns 2, because the 3rd second occurs within the 2nd TS (which starts at second 2 and is 2 seconds long, i.e. contains absolute seconds 2-4 of the video). The returned MediaSequence should be modded on the length of the TSes, to get the proper TSes to serve. Each time the mod is 0, the 0 TS should also insert a #EXT-X-DISCONTINUITY into the manifest, via M3U8TS.Discontinuity, in order to play correctly, assuming the TS files have correct continuity counters.
func GetTotalTime ¶
GetTotalTime returns the sum of the durations of all TSes in the given vod M3U8.
func SerializeLive ¶
SerializeLiveM3U8 serialized the given M3U8 object as a live m3u8 manifest file. It assumes the given m3u8 is valid, and does not check validity or existence of fields. Callers should check validity before calling (a M3U8 returned by TransformVodToLive without error is guaranteed valid).
Types ¶
type M3U8 ¶
type TargetType ¶
type TargetType int
const ( TargetTypeInvalid TargetType = iota TargetTypeManifest TargetTypeTS )