player

package
v0.0.0-...-b4cc8dc Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MPV (https://mpv.io) is a free, open source, and cross-platform media player
	MPV = "mpv"
	// VLC (https://www.videolan.org/vlc/index.html) is a free and open source
	// cross-platform multimedia player and framework that plays most multimedia
	// files as well as DVDs, Audio CDs, VCDs, and various streaming protocols.
	VLC = "vlc"
	OMX = "omx"
)

<GLOBAL>

Variables

View Source
var Players = []string{MPV, VLC}

<GLOBAL>

Functions

This section is empty.

Types

type Info

type Info struct {
	Title     string
	Thumbnail string
	Volume    float64
	Position  float64
	Playing   bool
}

Info represents the current state of the video player

type Player

type Player struct {
	State *state
	// contains filtered or unexported fields
}

Player is an abstraction of a video player. the backend player is determined by the platform

func New

func New(player string) (*Player, error)

New creates a player interface

func (*Player) Add

func (p *Player) Add(url string) error

Add adds the url to the playlist

func (*Player) Close

func (p *Player) Close()

Close cleans up resources

func (*Player) Next

func (p *Player) Next() error

Next sets the player to the next video in the playlist

func (*Player) Pause

func (p *Player) Pause() error

Pause pauses the current video. If there's no video, nothing will happen

func (*Player) Play

func (p *Player) Play() error

Play plays the current video. If there's no video, nothing will happen

func (*Player) Seek

func (p *Player) Seek(position float64) error

Seek sets the current video to position (from 0 - 1.0)

func (*Player) Stop

func (p *Player) Stop() error

Stop stops the player and clear up the playlist

Jump to

Keyboard shortcuts

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