media_player

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ACTIVITY_BLANK = "com.amazon.tv.launcher/com.amazon.tv.launcher.ui.HomeActivity_vNext"
View Source
const ACTIVITY_SPOTIFY = "com.spotify.tv.android/com.spotify.tv.android.SpotifyTVActivity"

Variables

This section is empty.

Functions

This section is empty.

Types

type Functions

type Functions interface {
	Play()
	Pause()
	Stop()
	Next()
	Previous()
	Teardown()
	Setup()
	Update()
	ShuffleOn()
	ShuffleOff()
	Item(video_id string)
	Playlist(playlist_id string)
	NextItem()
	NextPlaylist()
	PreviousItem()
	PreviousPlaylist()
}

type MediaPlayer

type MediaPlayer struct {
	Config       *types.ConfigFile    `json:"config"`
	DB           *bolt_api.DB         `json:"-"`
	MediaPlayers map[string]Functions `json:"-"`
	ADB          adb_wrapper.Wrapper  `json:"-"`
	TV           *tv.TV               `json:"-"`
	Status       Status               `json:"status"`
}

func New

func New(db *bolt_api.DB, config *types.ConfigFile) (result *MediaPlayer)

func (*MediaPlayer) ADBConnect

func (s *MediaPlayer) ADBConnect() (connection adb_wrapper.Wrapper)

func (*MediaPlayer) Get

func (s *MediaPlayer) Get(key string) (result string)

func (*MediaPlayer) GetStatus

func (s *MediaPlayer) GetStatus() (result Status)

func (*MediaPlayer) Prepare

func (s *MediaPlayer) Prepare()

func (*MediaPlayer) Run

func (s *MediaPlayer) Run(player_name string, command string, args ...interface{}) (result string)

func (*MediaPlayer) Set

func (s *MediaPlayer) Set(key string, value string) (result string)

type Spotify

type Spotify struct {
	*MediaPlayer
	Name string `yaml:"name"`
}

func (*Spotify) ContinuousOpen

func (mp *Spotify) ContinuousOpen()

func (*Spotify) GetActiveButtonIndex

func (mp *Spotify) GetActiveButtonIndex() (result int)

func (*Spotify) IsShuffleOn

func (mp *Spotify) IsShuffleOn() (result bool)

func (*Spotify) Item

func (mp *Spotify) Item(item_id string)

5Muvh0ooAJkSgBylFyI3su

func (*Spotify) Next

func (mp *Spotify) Next()

func (*Spotify) NextItem

func (mp *Spotify) NextItem(song_id string)

func (*Spotify) NextPlaylist

func (mp *Spotify) NextPlaylist(playlist_id string)

func (*Spotify) Pause

func (mp *Spotify) Pause()

func (*Spotify) Play

func (mp *Spotify) Play()

func (*Spotify) PlayPlaylistWithShuffle

func (mp *Spotify) PlayPlaylistWithShuffle(playlist_id string)

func (*Spotify) Playlist

func (mp *Spotify) Playlist(playlist_id string)

func (*Spotify) PressPreviousButton

func (mp *Spotify) PressPreviousButton()

func (*Spotify) Previous

func (mp *Spotify) Previous()

func (*Spotify) PreviousItem

func (mp *Spotify) PreviousItem(song_id string)

func (*Spotify) PreviousPlaylist

func (mp *Spotify) PreviousPlaylist(playlist_id string)

func (*Spotify) ReopenSpotifyApp

func (mp *Spotify) ReopenSpotifyApp()

func (*Spotify) Setup

func (mp *Spotify) Setup()

func (*Spotify) ShuffleOff

func (mp *Spotify) ShuffleOff() (was_on bool)

func (*Spotify) ShuffleOn

func (mp *Spotify) ShuffleOn() (was_on bool)

func (*Spotify) Stop

func (mp *Spotify) Stop()

func (*Spotify) Teardown

func (mp *Spotify) Teardown()

func (*Spotify) Update

func (mp *Spotify) Update()

type Status

type Status struct {
	StartTime                        string        `json:"start_time"`
	StartTimeOBJ                     time.Time     `json:"-"`
	PreviousPlayerName               string        `json:"previous_player_name"`
	PreviousPlayerCommand            string        `json:"previous_player_command"`
	PreviousStartTime                string        `json:"previous_start_time"`
	PreviousStartTimeOBJ             time.Time     `json:"-"`
	PreviousStartTimeDuration        time.Duration `json:"-"`
	PreviousStartTimeDurationSeconds float64       `json:"previous_start_time_duration_seconds"`
	ADBTopWindow                     string        `json:"adb_top_window"`
	ADBVolume                        int           `json:"adb_volume"`
	TV                               tv.Status     `json:"tv"`
}

type Twitch

type Twitch struct {
	*MediaPlayer
	Name string `yaml:"name"`
}

func (*Twitch) Next

func (t *Twitch) Next()

func (*Twitch) Pause

func (t *Twitch) Pause()

func (*Twitch) Play

func (t *Twitch) Play()

func (*Twitch) PlayPlaylist

func (mp *Twitch) PlayPlaylist(playlist_id string)

func (*Twitch) PlayPlaylistWithShuffle

func (mp *Twitch) PlayPlaylistWithShuffle(playlist_id string)

func (*Twitch) Previous

func (t *Twitch) Previous()

func (*Twitch) Setup

func (t *Twitch) Setup()

func (*Twitch) Stop

func (t *Twitch) Stop()

func (*Twitch) Teardown

func (t *Twitch) Teardown()

func (*Twitch) Update

func (t *Twitch) Update()

type YouTube

type YouTube struct {
	*MediaPlayer
	Name string `yaml:"youtube"`
}

func (*YouTube) Next

func (t *YouTube) Next()

func (*YouTube) Pause

func (t *YouTube) Pause()

func (*YouTube) Play

func (t *YouTube) Play()

func (*YouTube) PlayPlaylist

func (mp *YouTube) PlayPlaylist(playlist_id string)

func (*YouTube) PlayPlaylistWithShuffle

func (mp *YouTube) PlayPlaylistWithShuffle(playlist_id string)

func (*YouTube) Previous

func (t *YouTube) Previous()

func (*YouTube) Setup

func (t *YouTube) Setup()

func (*YouTube) Stop

func (t *YouTube) Stop()

func (*YouTube) Teardown

func (t *YouTube) Teardown()

func (*YouTube) Update

func (t *YouTube) Update()

Jump to

Keyboard shortcuts

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