Documentation ¶
Index ¶
- Constants
- func AttachableReference(v inv.VideoData) inv.SearchData
- func Context(cancel bool) context.Context
- func Hide()
- func IsHistoryInputFocused() bool
- func IsInfoShown() bool
- func IsPlayerShown() bool
- func IsQueueAreaFocused() bool
- func IsQueueEmpty() bool
- func IsQueueFocused() bool
- func IsQueueRecommendsFocused() bool
- func Keybindings(event *tcell.EventKey) *tcell.EventKey
- func ParseQuery()
- func Play(audio, current bool, mediaInfo ...inv.SearchData)
- func Resize(width int, force ...struct{})
- func Show()
- func Start()
- func Stop()
- func ToggleInfo(hide ...struct{})
- type CustomSeeker
- func (c *CustomSeeker) Hide()
- func (c *CustomSeeker) IsOpen() bool
- func (c *CustomSeeker) Keybindings(event *tcell.EventKey) *tcell.EventKey
- func (c *CustomSeeker) SeekToPosition()
- func (c *CustomSeeker) Setup()
- func (c *CustomSeeker) Show()
- func (c *CustomSeeker) ThemeProperty() theme.ThemeProperty
- type Fetcher
- func (f *Fetcher) Add(info inv.SearchData, audio bool, newdata ...*FetcherData) (*FetcherData, context.Context)
- func (f *Fetcher) Cancel(data *FetcherData)
- func (f *Fetcher) CancelAll(clear bool)
- func (f *Fetcher) Clear()
- func (f *Fetcher) ClearErrors()
- func (f *Fetcher) Count() int
- func (f *Fetcher) Fetch(info inv.SearchData, audio bool, newdata ...*FetcherData) (inv.SearchData, error)
- func (f *Fetcher) FetchAll()
- func (f *Fetcher) Get(position int) (FetcherData, bool)
- func (f *Fetcher) GetCell(row, column int) *tview.TableCell
- func (f *Fetcher) GetColumnCount() int
- func (f *Fetcher) GetReference(do ...func(d *FetcherData)) (*FetcherData, bool)
- func (f *Fetcher) GetRowCount() int
- func (f *Fetcher) Hide()
- func (f *Fetcher) IsOpen() bool
- func (f *Fetcher) Keybindings(event *tcell.EventKey) *tcell.EventKey
- func (f *Fetcher) MarkStatus(data *FetcherData, status FetcherStatus, err error, text ...string)
- func (f *Fetcher) Remove(data *FetcherData)
- func (f *Fetcher) Setup()
- func (f *Fetcher) Show()
- func (f *Fetcher) ThemeProperty() theme.ThemeProperty
- func (f *Fetcher) UpdateTag(clear bool)
- type FetcherData
- type FetcherStatus
- type History
- type Player
- type Queue
- func (q *Queue) Add(video inv.VideoData, audio bool, uri ...[2]string)
- func (q *Queue) AddRecommendations(video inv.VideoData)
- func (q *Queue) AutoPlay(force bool)
- func (q *Queue) Clear()
- func (q *Queue) Context(cancel bool) context.Context
- func (q *Queue) Count() int
- func (q *Queue) Delete(position int)
- func (q *Queue) Get(position int) (QueueData, bool)
- func (q *Queue) GetCell(row, column int) *tview.TableCell
- func (q *Queue) GetColumnCount() int
- func (q *Queue) GetCurrent() (QueueData, bool)
- func (q *Queue) GetEntryPointer(position int) (*QueueData, bool)
- func (q *Queue) GetMediaType() string
- func (q *Queue) GetPlayingIndex() int
- func (q *Queue) GetRect() (int, int, int, int)
- func (q *Queue) GetRepeatMode() mp.RepeatMode
- func (q *Queue) GetRowCount() int
- func (q *Queue) GetShuffleMode() bool
- func (q *Queue) GetTitle() string
- func (q *Queue) Hide()
- func (q *Queue) IsOpen() bool
- func (q *Queue) IsQueueShown() bool
- func (q *Queue) Keybindings(event *tcell.EventKey) *tcell.EventKey
- func (q *Queue) LoadPlaylist(ctx context.Context, plpath string, replace bool) error
- func (q *Queue) MarkEntryMediaType(key keybinding.Key)
- func (q *Queue) MarkPlayingEntry(status QueueEntryStatus)
- func (q *Queue) Move(before, after int)
- func (q *Queue) Next(force ...struct{})
- func (q *Queue) Play(norender ...struct{})
- func (q *Queue) Position() int
- func (q *Queue) Previous(force ...struct{})
- func (q *Queue) SelectCurrentRow(row ...int)
- func (q *Queue) SelectRecentEntry()
- func (q *Queue) SetData(row int, data QueueData)
- func (q *Queue) SetPosition(position int)
- func (q *Queue) SetReference(row int, video inv.VideoData, checkID ...struct{})
- func (q *Queue) SetState(state string)
- func (q *Queue) SetTimestamp(position int)
- func (q *Queue) Setup()
- func (q *Queue) Show()
- func (q *Queue) Shuffle(position, count int, force ...struct{}) bool
- func (q *Queue) SwitchToPosition(position int, autoplay ...struct{})
- func (q *Queue) ThemeProperty() theme.ThemeProperty
- func (q *Queue) ToggleRepeatMode()
- func (q *Queue) ToggleShuffle()
- type QueueData
- type QueueEntryStatus
Constants ¶
const ( SeekMaxHours = 600 SeekMaxMinutesAndSeconds = 59 SeekInputHoursLength = 3 SeekInputMinutesAndSecondsLength = 2 SeekInputByPosition = 0 SeekInputHoursPosition = 1 SeekInputMinutesPosition = 2 SeekInputSecondsPosition = 3 )
const ( FetchColumnSize = 7 FetchStatusMarker = FetchColumnSize - 1 )
const ( QueueColumnSize = 10 QueuePlayingMarker = QueueColumnSize - 2 QueueMediaMarker = QueueColumnSize - 5 )
Variables ¶
This section is empty.
Functions ¶
func AttachableReference ¶ added in v0.4.2
func AttachableReference(v inv.VideoData) inv.SearchData
AttachableReference returns an attachable reference to the video item.
func IsHistoryInputFocused ¶
func IsHistoryInputFocused() bool
IsHistoryInputFocused returns whether the history search bar is focused.
func IsInfoShown ¶
func IsInfoShown() bool
IsInfoShown returns whether the player information is shown.
func IsPlayerShown ¶ added in v0.3.3
func IsPlayerShown() bool
IsPlayerShown returns whether the player is shown.
func IsQueueAreaFocused ¶ added in v0.4.3
func IsQueueAreaFocused() bool
IsQueueAreaFocused returns whether the queue area is focused.
func IsQueueFocused ¶
func IsQueueFocused() bool
IsQueueFocused returns whether the queue is focused.
func IsQueueRecommendsFocused ¶ added in v0.4.3
func IsQueueRecommendsFocused() bool
IsQueueRecommendsFocused returns whether the queue recommendations page is focused.
func Keybindings ¶
func Keybindings(event *tcell.EventKey) *tcell.EventKey
Keybindings define the main player keybindings.
func ParseQuery ¶
func ParseQuery()
ParseQuery parses the play-audio or play-video commandline parameters, and plays the provided URL.
func Play ¶
func Play(audio, current bool, mediaInfo ...inv.SearchData)
Play plays the currently selected audio/video entry.
Types ¶
type CustomSeeker ¶ added in v0.4.3
type CustomSeeker struct {
// contains filtered or unexported fields
}
CustomSeeker describes the custom playback seeker.
func (*CustomSeeker) Hide ¶ added in v0.4.3
func (c *CustomSeeker) Hide()
Hide hides the custom seeker.
func (*CustomSeeker) IsOpen ¶ added in v0.4.3
func (c *CustomSeeker) IsOpen() bool
IsOpen returns whether the custom seeker is open.
func (*CustomSeeker) Keybindings ¶ added in v0.4.3
func (c *CustomSeeker) Keybindings(event *tcell.EventKey) *tcell.EventKey
Keybindings define the keybindings for the custom seeker.
func (*CustomSeeker) SeekToPosition ¶ added in v0.4.3
func (c *CustomSeeker) SeekToPosition()
SeekToPosition seeks to the specified position.
func (*CustomSeeker) Setup ¶ added in v0.4.3
func (c *CustomSeeker) Setup()
Setup sets up the custom seeker.
func (*CustomSeeker) Show ¶ added in v0.4.3
func (c *CustomSeeker) Show()
Show shows the custom seeker.
func (*CustomSeeker) ThemeProperty ¶ added in v0.4.3
func (c *CustomSeeker) ThemeProperty() theme.ThemeProperty
ThemeProperty returns the custom seeker's theme property.
type Fetcher ¶ added in v0.3.7
type Fetcher struct { tview.TableContentReadOnly // contains filtered or unexported fields }
Fetcher describes the media fetcher.
func (*Fetcher) Add ¶ added in v0.3.7
func (f *Fetcher) Add( info inv.SearchData, audio bool, newdata ...*FetcherData, ) (*FetcherData, context.Context)
Add sets/adds entry data in the media fetcher.
func (*Fetcher) Cancel ¶ added in v0.3.7
func (f *Fetcher) Cancel(data *FetcherData)
Cancel cancels fetching an item in the media fetcher.
func (*Fetcher) CancelAll ¶ added in v0.3.7
Cancel cancels fetching all the items in the media fetcher.
func (*Fetcher) ClearErrors ¶ added in v0.3.7
func (f *Fetcher) ClearErrors()
ClearErrors clears all the errors in the media fetcher.
func (*Fetcher) Fetch ¶ added in v0.3.7
func (f *Fetcher) Fetch(info inv.SearchData, audio bool, newdata ...*FetcherData) (inv.SearchData, error)
Fetch loads media and adds it to the media fetcher.
func (*Fetcher) FetchAll ¶ added in v0.3.7
func (f *Fetcher) FetchAll()
FetchAll fetches all the items in the media fetcher.
func (*Fetcher) Get ¶ added in v0.3.7
func (f *Fetcher) Get(position int) (FetcherData, bool)
Get returns the entry data at the specified position from the media fetcher.
func (*Fetcher) GetCell ¶ added in v0.3.7
GetCell returns a TableCell from the media fetcher entry data at the specified row and column.
func (*Fetcher) GetColumnCount ¶ added in v0.3.7
GetColumnCount returns the number of columns in the table.
func (*Fetcher) GetReference ¶ added in v0.3.7
func (f *Fetcher) GetReference(do ...func(d *FetcherData)) (*FetcherData, bool)
GetReference returns the reference of the currently selected column in the table.
func (*Fetcher) GetRowCount ¶ added in v0.3.7
GetRowCount returns the number of rows in the table.
func (*Fetcher) Keybindings ¶ added in v0.3.7
func (f *Fetcher) Keybindings(event *tcell.EventKey) *tcell.EventKey
Keybindings define the keybindings for the media fetcher.
func (*Fetcher) MarkStatus ¶ added in v0.3.7
func (f *Fetcher) MarkStatus(data *FetcherData, status FetcherStatus, err error, text ...string)
MarkStatus marks the status of the media fetcher entry.
func (*Fetcher) Remove ¶ added in v0.3.7
func (f *Fetcher) Remove(data *FetcherData)
Remove removes entry data from the media fetcher.
func (*Fetcher) ThemeProperty ¶ added in v0.3.8
func (f *Fetcher) ThemeProperty() theme.ThemeProperty
ThemeProperty returns the media fetcher's theme property.
type FetcherData ¶ added in v0.3.7
type FetcherData struct { Columns [FetchColumnSize]*tview.TableCell Info inv.SearchData Error error Audio bool // contains filtered or unexported fields }
FetcherData describes the media fetcher data.
type FetcherStatus ¶ added in v0.3.7
type FetcherStatus string
FetcherStatus describes the status of each media fetcher entry.
const ( FetcherStatusAdding FetcherStatus = "Adding" FetcherStatusError FetcherStatus = "Error" )
type History ¶
type History struct {
// contains filtered or unexported fields
}
History describes the layout of the history popup and stores the entries.
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player stores the layout for the player.
type Queue ¶
type Queue struct { tview.TableContentReadOnly // contains filtered or unexported fields }
Queue describes the media queue.
func (*Queue) AddRecommendations ¶ added in v0.4.3
AddRecommendations adds the video-based recommendations to the queue modal.
func (*Queue) AutoPlay ¶ added in v0.3.7
AutoPlay automatically selects what to play after the current entry has finished playing.
func (*Queue) Delete ¶ added in v0.3.7
Delete removes a entry from the specified position within the queue.
func (*Queue) Get ¶ added in v0.3.7
Get returns the entry data at the specified position from the queue.
func (*Queue) GetCell ¶ added in v0.3.7
GetCell returns a TableCell from the queue entry data at the specified row and column.
func (*Queue) GetColumnCount ¶ added in v0.3.7
GetColumnCount returns the number of columns in the table.
func (*Queue) GetCurrent ¶ added in v0.3.7
GetCurrent returns the entry data at the current position from the queue.
func (*Queue) GetEntryPointer ¶ added in v0.3.7
GetEntryPointer returns a pointer to the entry data at the specified position from the queue.
func (*Queue) GetMediaType ¶ added in v0.3.7
GetMediaType returns the media type for the currently playing entry.
func (*Queue) GetPlayingIndex ¶ added in v0.3.7
GetPlayingIndex returns the index of the currently playing entry.
func (*Queue) GetRepeatMode ¶ added in v0.3.7
func (q *Queue) GetRepeatMode() mp.RepeatMode
GetRepeatMode returns the current repeat mode.
func (*Queue) GetRowCount ¶ added in v0.3.7
GetRowCount returns the number of rows in the table.
func (*Queue) GetShuffleMode ¶ added in v0.3.7
GetShuffleMode returns the current shuffle mode.
func (*Queue) GetTitle ¶ added in v0.3.7
GetTitle returns the title for the currently playing entry.
func (*Queue) IsQueueShown ¶ added in v0.4.3
IsQueueShown returns whether the queue page is shown.
func (*Queue) Keybindings ¶
func (q *Queue) Keybindings(event *tcell.EventKey) *tcell.EventKey
Keybindings define the keybindings for the queue.
func (*Queue) LoadPlaylist ¶ added in v0.3.7
LoadPlaylist loads the provided playlist into MPV. If replace is true, the provided playlist will replace the current playing queue. renewLiveURL is a function to check and renew expired liev URLs in the playlist.
func (*Queue) MarkEntryMediaType ¶ added in v0.3.7
func (q *Queue) MarkEntryMediaType(key keybinding.Key)
MarkEntryMediaType marks the selected queue entry as 'Audio/Video'.
func (*Queue) MarkPlayingEntry ¶ added in v0.3.7
func (q *Queue) MarkPlayingEntry(status QueueEntryStatus)
MarkPlayingEntry marks the current queue entry as 'playing/loading'.
func (*Queue) Next ¶ added in v0.3.7
func (q *Queue) Next(force ...struct{})
Next selects the next entry from the current position in the queue.
func (*Queue) Play ¶ added in v0.3.7
func (q *Queue) Play(norender ...struct{})
Play plays the entry at the current queue position.
func (*Queue) Previous ¶ added in v0.3.7
func (q *Queue) Previous(force ...struct{})
Previous selects the previous entry from the current position in the queue.
func (*Queue) SelectCurrentRow ¶ added in v0.3.7
SelectCurrentRow selects the specified row within the table.
func (*Queue) SelectRecentEntry ¶ added in v0.3.7
func (q *Queue) SelectRecentEntry()
SelectRecentEntry selects the recent-most entry in the queue.
func (*Queue) SetPosition ¶ added in v0.3.7
SetPosition sets the current position within the queue.
func (*Queue) SetReference ¶ added in v0.3.7
SetReference sets the reference for the data at the specified row in the queue.
func (*Queue) SetTimestamp ¶ added in v0.4.3
SetTimestamp seeks to the available timestamp during playback.
func (*Queue) SwitchToPosition ¶ added in v0.3.7
SwitchToPosition switches to the specified position within the queue.
func (*Queue) ThemeProperty ¶ added in v0.3.8
func (q *Queue) ThemeProperty() theme.ThemeProperty
ThemeProperty returns the queue's theme property.
func (*Queue) ToggleRepeatMode ¶ added in v0.3.7
func (q *Queue) ToggleRepeatMode()
ToggleRepeatMode toggles the repeat mode.
func (*Queue) ToggleShuffle ¶ added in v0.3.7
func (q *Queue) ToggleShuffle()
ToggleShuffle toggles the shuffle mode.
type QueueData ¶
type QueueData struct { URI [2]string Reference inv.VideoData Columns [QueueColumnSize]*tview.TableCell Audio, Playing, HasPlayed bool Timestamp *int64 }
QueueData describes the queue entry data.
type QueueEntryStatus ¶ added in v0.3.7
type QueueEntryStatus string
QueueEntryStatus describes the status of a queue entry.
const ( EntryFetching QueueEntryStatus = "Fetching" EntryLoading QueueEntryStatus = "Loading" EntryPlaying QueueEntryStatus = "Playing" EntryStopped QueueEntryStatus = "Stopped" )