playlist.go 606 B

1234567891011121314151617181920
  1. package models
  2. // Segment represents a segment of the live stream.
  3. type Segment struct {
  4. VariantIndex int // The bitrate variant
  5. FullDiskPath string // Where it lives on disk
  6. RelativeUploadPath string // Path it should have remotely
  7. RemoteURL string
  8. }
  9. // Variant represents a single video variant and the segments that make it up.
  10. type Variant struct {
  11. VariantIndex int
  12. Segments map[string]*Segment
  13. }
  14. // GetSegmentForFilename gets the segment for the provided filename.
  15. func (v *Variant) GetSegmentForFilename(filename string) *Segment {
  16. return v.Segments[filename]
  17. }