Documentation ¶
Overview ¶
package datastore provides models for data structures, and functions for getting and saving them to Redis
Index ¶
- func GetVideoTrack(trackId string) media.VideoTrack
- func SaveVideoTrack(v media.VideoTrack) error
- type Channel
- func (c *Channel) BroadcastSegment(v media.VideoTrack, pc int64, breaks bool)
- func (c Channel) CurrentItem() (media.VideoTrack, error, *PlaylistItem)
- func (c Channel) GetPlaybackCounter() int64
- func (c *Channel) Play()
- func (c *Channel) PlayTrack(currentItem media.VideoTrack) error
- func (c Channel) PlaybackCounterKey() string
- func (c Channel) PlaybackQueueKey() string
- func (c *Channel) PlaylistData() string
- func (c Channel) PushItem(i PlaylistItem) (err error)
- func (c Channel) SetPlaybackCounter(npc int64) error
- type PlaylistItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVideoTrack ¶
func GetVideoTrack(trackId string) media.VideoTrack
func SaveVideoTrack ¶
func SaveVideoTrack(v media.VideoTrack) error
Types ¶
type Channel ¶
type Channel struct { Identifier string // Identifier is the unique part of the redis key // contains filtered or unexported fields }
struct Channel describes a broadcast channel
func GetChannel ¶
function GetChannel retrieves Channel information from the datastore given a channel identifier. It returns the channel and any error
func (*Channel) BroadcastSegment ¶
func (c *Channel) BroadcastSegment(v media.VideoTrack, pc int64, breaks bool)
function BroadcastSegment broadcasts a single segment on the channel
func (Channel) CurrentItem ¶
func (c Channel) CurrentItem() (media.VideoTrack, error, *PlaylistItem)
function CurrentItem() returns the currently playing VideoTrack
func (Channel) GetPlaybackCounter ¶
func (*Channel) PlayTrack ¶
func (c *Channel) PlayTrack(currentItem media.VideoTrack) error
Function PlayTrack broadcasta a track on the channel until the track is finished
func (Channel) PlaybackCounterKey ¶
function PlaybackCounterKey returns the data store key for the playback counter
func (Channel) PlaybackQueueKey ¶
function PlaybackQueueKey returns the data store key for the playback queue
func (*Channel) PlaylistData ¶
function PlaylistData() returns the current channel data in m3u8 HTTP live streaming playlist format
func (Channel) PushItem ¶
func (c Channel) PushItem(i PlaylistItem) (err error)
Function PushItem serializes a VideoTrack to storage, and queues it for playback at the end of the track queue
func (Channel) SetPlaybackCounter ¶
type PlaylistItem ¶
type PlaylistItem struct { TrackId string // identifier of the track Loop bool // whether the video should loop indefinitely LoopUntil *time.Time }
struct PlaylistItem describes a video playback instruction in a channel's playback queue
func (PlaylistItem) VideoTrack ¶
func (pi PlaylistItem) VideoTrack() media.VideoTrack