media

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package media implements the Media domain. This domain allows detailed inspection of media elements

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Media domain with the connection set to conn.

Types

type PlayerEvent

type PlayerEvent struct {
	Type      PlayerEventType `json:"type"`      // No description.
	Timestamp Timestamp       `json:"timestamp"` // Events are timestamped relative to the start of the player creation not relative to the start of playback.
	Name      string          `json:"name"`      // No description.
	Value     string          `json:"value"`     // No description.
}

PlayerEvent

type PlayerEventType

type PlayerEventType string

PlayerEventType Break out events into different types

const (
	PlayerEventTypeNotSet        PlayerEventType = ""
	PlayerEventTypePlaybackEvent PlayerEventType = "playbackEvent"
	PlayerEventTypeSystemEvent   PlayerEventType = "systemEvent"
	PlayerEventTypeMessageEvent  PlayerEventType = "messageEvent"
)

PlayerEventType as enums.

func (PlayerEventType) String

func (e PlayerEventType) String() string

func (PlayerEventType) Valid

func (e PlayerEventType) Valid() bool

type PlayerEventsAddedClient

type PlayerEventsAddedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*PlayerEventsAddedReply, error)
	rpcc.Stream
}

PlayerEventsAddedClient is a client for PlayerEventsAdded events. Send events as a list, allowing them to be batched on the browser for less congestion. If batched, events must ALWAYS be in chronological order.

type PlayerEventsAddedReply

type PlayerEventsAddedReply struct {
	PlayerID PlayerID      `json:"playerId"` // No description.
	Events   []PlayerEvent `json:"events"`   // No description.
}

PlayerEventsAddedReply is the reply for PlayerEventsAdded events.

type PlayerID

type PlayerID string

PlayerID Players will get an ID that is unique within the agent context.

type PlayerPropertiesChangedClient

type PlayerPropertiesChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*PlayerPropertiesChangedReply, error)
	rpcc.Stream
}

PlayerPropertiesChangedClient is a client for PlayerPropertiesChanged events. This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.

type PlayerPropertiesChangedReply

type PlayerPropertiesChangedReply struct {
	PlayerID   PlayerID         `json:"playerId"`   // No description.
	Properties []PlayerProperty `json:"properties"` // No description.
}

PlayerPropertiesChangedReply is the reply for PlayerPropertiesChanged events.

type PlayerProperty

type PlayerProperty struct {
	Name  string  `json:"name"`            // No description.
	Value *string `json:"value,omitempty"` // No description.
}

PlayerProperty Player Property type

type PlayersCreatedClient

type PlayersCreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*PlayersCreatedReply, error)
	rpcc.Stream
}

PlayersCreatedClient is a client for PlayersCreated events. Called whenever a player is created, or when a new agent joins and receives a list of active players. If an agent is restored, it will receive the full list of player ids and all events again.

type PlayersCreatedReply

type PlayersCreatedReply struct {
	Players []PlayerID `json:"players"` // No description.
}

PlayersCreatedReply is the reply for PlayersCreated events.

type Timestamp

type Timestamp float64

Timestamp

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. Encodes to null if t is zero.

func (Timestamp) String

func (t Timestamp) String() string

String calls (time.Time).String().

func (Timestamp) Time

func (t Timestamp) Time() time.Time

Time parses the Unix time.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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