datastore

package
v0.0.0-...-4b4f84d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package datastore provides models for data structures, and functions for getting and saving them to Redis

Index

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

func GetChannel(channelId string) (rv *Channel, err error)

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 (c Channel) GetPlaybackCounter() int64

func (*Channel) Play

func (c *Channel) Play()

Function Play starts the broadcast timer

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

func (c Channel) PlaybackCounterKey() string

function PlaybackCounterKey returns the data store key for the playback counter

func (Channel) PlaybackQueueKey

func (c Channel) PlaybackQueueKey() string

function PlaybackQueueKey returns the data store key for the playback queue

func (*Channel) PlaylistData

func (c *Channel) PlaylistData() string

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

func (c Channel) SetPlaybackCounter(npc int64) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL