media

package
v0.0.0-...-f38834e Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const BufferedStreamType streamType = "BUFFERED"

BufferedStreamType is for a stream that should be buffered/loaded.

View Source
const LiveStreamType streamType = "LIVE"

LiveStreamType is for videos that are livestreaming. (Twitch/Youtube livestreams, etc)

View Source
const MovieMetadataType int = 1
View Source
const MusicTrackMetadataType int = 3
View Source
const NoneStreamType streamType = "NONE"

NoneStreamType is for when you don't want to define a stream type.

View Source
const PhotoMediaMetadataType int = 4
View Source
const TvShowMetadataType int = 2

Variables

This section is empty.

Functions

func NewContentID

func NewContentID(contentIDString string) (contentID, error)

NewContentID creates a new contentID object from some string.

func NewContentType

func NewContentType(cTypeString string) (contentType, error)

NewContentType creates a new contentType object from some string.

func NewGenericMediaDataBuilder

func NewGenericMediaDataBuilder(contentID contentID, contentType contentType, sType streamType) (genericMediaDataBuilder, error)

NewGenericMediaDataBuilder is a constructor for the media data builder class

Types

type ContentIDLengthError

type ContentIDLengthError struct {
	// contains filtered or unexported fields
}

ContentIDLengthError is error caused by input string for contentID constructor being longer than max.

func (*ContentIDLengthError) Error

func (er *ContentIDLengthError) Error() string

type InvalidArgumentError

type InvalidArgumentError struct {
	// contains filtered or unexported fields
}

func (*InvalidArgumentError) Error

func (er *InvalidArgumentError) Error() string

type LoadCommand

type LoadCommand struct {
	primitives.PayloadHeaders
	Media       MediaData              `json:"media"`
	Autoplay    bool                   `json:"autoplay,omitempty"`
	CurrentTime float64                `json:"currentTime,omitempty"`
	CustomData  map[string]interface{} `json:"customData,omitempty"`
}

type MediaCommand

type MediaCommand struct {
	primitives.PayloadHeaders
	MediaSessionID int `json:"mediaSessionId"`
}

type MediaData

type MediaData struct {
	//ContentID is the identifier for the content to be loaded by the current receiver application in the chromecast.
	//Usually this is just the URL.
	//ContentType is the MIME type of the media
	ContentID   string                 `json:"contentId"`
	ContentType string                 `json:"contentType"` //data MIME
	StreamType  string                 `json:"streamType"`  // (NONE, BUFFERED, or LIVE)
	Duration    *float64               `json:"duration,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"` //stores a mediadata
	CustomData  map[string]interface{} `json:"customData,omitempty"`
}

MediaData is data format for message to send to chromecast to play a (vid/image/tvshow/music video/etc) via generic media player. https://developers.google.com/cast/docs/reference/messages#MediaData is the general info.

type MediaDataBuilder

type MediaDataBuilder interface {
	SetContentID(string)
	SetContentType(string)
	SetStreamType(string)
	SetDuration(float64)
	SetCustomData(map[string]interface{})
	Build() (MediaData, error)
}

MediaDataBuilder interface for generic media player media data messages to pass to chromecast.

type MediaStatus

type MediaStatus struct {
	primitives.PayloadHeaders
	MediaSessionID         int                    `json:"mediaSessionId"`
	PlaybackRate           float64                `json:"playbackRate"`
	PlayerState            string                 `json:"playerState"`
	CurrentTime            float64                `json:"currentTime"`
	SupportedMediaCommands int                    `json:"supportedMediaCommands"`
	Volume                 *Volume                `json:"volume,omitempty"`
	CustomData             map[string]interface{} `json:"customData"`
	IdleReason             string                 `json:"idleReason"`
	Media                  MediaData              `json:"media,omitempty"`
}

type MediaStatusResponse

type MediaStatusResponse struct {
	primitives.PayloadHeaders
	Status []*MediaStatus `json:"status,omitempty"`
}

type MovieMediaMetadata

type MovieMediaMetadata struct {
	StandardMediaMetadata
	Studio      string
	Subtitle    string
	Images      []string
	ReleaseDate string
}

TODO

type MusicTrackMediaMetadata

type MusicTrackMediaMetadata struct {
	StandardMediaMetadata
	Images      []string
	AlbumName   string
	AlbumArtist string
	Artist      string
	Composer    string
	TrackNumber int
	DiscNumber  int
	ReleaseDate string
}

TODO

type PhotoTrackMediaDataBuilder

type PhotoTrackMediaDataBuilder struct {
	// contains filtered or unexported fields
}

GenericMediaDataBuilder component for building up mediadatabuilders

func (*PhotoTrackMediaDataBuilder) Build

func (builder *PhotoTrackMediaDataBuilder) Build() (MediaData, error)

Build returns a standard mediadata object from its current data.

func (*PhotoTrackMediaDataBuilder) SetArtist

func (builder *PhotoTrackMediaDataBuilder) SetArtist(artist string)

SetArtist sets the builder's artist

func (*PhotoTrackMediaDataBuilder) SetContentID

func (builder *PhotoTrackMediaDataBuilder) SetContentID(id contentID)

SetContentID sets the contentID field

func (*PhotoTrackMediaDataBuilder) SetContentType

func (builder *PhotoTrackMediaDataBuilder) SetContentType(contentType contentType)

func (*PhotoTrackMediaDataBuilder) SetCreationTime

func (builder *PhotoTrackMediaDataBuilder) SetCreationTime(creationTime time.Time)

TODO

func (*PhotoTrackMediaDataBuilder) SetCustomData

func (builder *PhotoTrackMediaDataBuilder) SetCustomData(customData map[string]interface{})

SetCustomData sets the custom data field

func (*PhotoTrackMediaDataBuilder) SetDuration

func (builder *PhotoTrackMediaDataBuilder) SetDuration(duration *float64)

SetDuration sets the contentType field

func (*PhotoTrackMediaDataBuilder) SetHeight

func (builder *PhotoTrackMediaDataBuilder) SetHeight(height int64)

SetArtist sets the builder's artist

func (*PhotoTrackMediaDataBuilder) SetLatitude

func (builder *PhotoTrackMediaDataBuilder) SetLatitude(latitude float64)

TODO

func (*PhotoTrackMediaDataBuilder) SetLocation

func (builder *PhotoTrackMediaDataBuilder) SetLocation(location string)

TODO

func (*PhotoTrackMediaDataBuilder) SetLongitude

func (builder *PhotoTrackMediaDataBuilder) SetLongitude(longitude float64)

TODO

func (*PhotoTrackMediaDataBuilder) SetStreamType

func (builder *PhotoTrackMediaDataBuilder) SetStreamType(sType streamType)

SetStreamType sets the streamType field

func (*PhotoTrackMediaDataBuilder) SetTitle

func (builder *PhotoTrackMediaDataBuilder) SetTitle(title string)

SetTitle sets the builder's title

func (*PhotoTrackMediaDataBuilder) SetWidth

func (builder *PhotoTrackMediaDataBuilder) SetWidth(width int64)

SetArtist sets the builder's artist

type PhotoTrackMediaMetadata

type PhotoTrackMediaMetadata struct {
	StandardMediaMetadata
	Artist           string
	Location         string
	Latitude         float64
	Longitude        float64
	Width            int64
	Height           int64
	CreationDateTime string
}

TODO

type SeekCommand

type SeekCommand struct {
	primitives.PayloadHeaders
	CurrentTime float64 `json:"currentTime"`
	ResumeState string  `json:"resumeState"`
}

SeekCommand is a type of command payload to be passed along the media channel.

func CreateSeekCommand

func CreateSeekCommand(position float64) SeekCommand

CreateSeekCommand creates a seekcommand object.

type StandardMediaMetadata

type StandardMediaMetadata struct {
	MetadataType int     `json:"metadataType"`
	Title        *string `json:"title,omitempty"`
}

StandardMediaMetadata is standard part for all metadata objects parts for mediadata objects.

type TvShowMediaMetadata

type TvShowMediaMetadata struct {
	StandardMediaMetadata
	Images          []string
	SeriesTitle     string
	Season          int
	Episode         int
	OriginalAirDate string
}

TODO

type Volume

type Volume struct {
	Level *float64 `json:"level,omitempty"`
	Muted *bool    `json:"muted,omitempty"`
}

Jump to

Keyboard shortcuts

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