Documentation
¶
Overview ¶
Package omxplayer is a simple library for controlling the omxplayer application on your Raspberry Pi from Go.
Index ¶
- func SetUser(u, h string)
- type Player
- func (p *Player) Action(action int32) error
- func (p *Player) Aspect() (float64, error)
- func (p *Player) CanControl() (bool, error)
- func (p *Player) CanGoNext() (bool, error)
- func (p *Player) CanGoPrevious() (bool, error)
- func (p *Player) CanPause() (bool, error)
- func (p *Player) CanPlay() (bool, error)
- func (p *Player) CanQuit() (bool, error)
- func (p *Player) CanRaise() (bool, error)
- func (p *Player) CanSeek() (bool, error)
- func (p *Player) CanSetFullscreen() (bool, error)
- func (p *Player) Duration() (int64, error)
- func (p *Player) Fullscreen() (bool, error)
- func (p *Player) HasTrackList() (bool, error)
- func (p *Player) HideSubtitles() error
- func (p *Player) HideVideo() error
- func (p *Player) Identity() (string, error)
- func (p *Player) IsReady() bool
- func (p *Player) IsRunning() bool
- func (p *Player) ListAudio() ([]string, error)
- func (p *Player) ListSubtitles() ([]string, error)
- func (p *Player) ListVideo() ([]string, error)
- func (p *Player) MaximumRate() (float64, error)
- func (p *Player) MinimumRate() (float64, error)
- func (p *Player) Mute() error
- func (p *Player) Next() error
- func (p *Player) Pause() error
- func (p *Player) Play() error
- func (p *Player) PlayPause() error
- func (p *Player) PlaybackStatus() (string, error)
- func (p *Player) Position() (int64, error)
- func (p *Player) Previous() error
- func (p *Player) Quit() error
- func (p *Player) ResHeight() (int64, error)
- func (p *Player) ResWidth() (int64, error)
- func (p *Player) Seek(amount int64) (int64, error)
- func (p *Player) SelectAudio(index int32) (bool, error)
- func (p *Player) SelectSubtitle(index int32) (bool, error)
- func (p *Player) SetPosition(path string, position int64) (int64, error)
- func (p *Player) ShowSubtitles() error
- func (p *Player) Stop() error
- func (p *Player) SupportedMimeTypes() ([]string, error)
- func (p *Player) SupportedURISchemes() ([]string, error)
- func (p *Player) UnHideVideo() error
- func (p *Player) Unmute() error
- func (p *Player) VideoStreamCount() (int64, error)
- func (p *Player) Volume(volume ...float64) (float64, error)
- func (p *Player) Wait(status chan error)
- func (p *Player) WaitForReady()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUser ¶
func SetUser(u, h string)
SetUser sets the username (u) and home directory (h) of the user that new omxplayer processes will be running as. This does not change which user the processes will be spawned as, it is just used to find the correct D-Bus configuration file after a new process has been started.
Types ¶
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
The Player struct provides access to all of omxplayer's D-Bus methods.
func New ¶
New returns a new Player instance that can be used to control an OMXPlayer instance that is playing the video located at the specified URL.
func (*Player) Action ¶
Action allows for executing keyboard commands. See https://github.com/popcornmix/omxplayer#action for more details.
func (*Player) Aspect ¶
Aspect returns the aspect ratio. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L362.
func (*Player) CanControl ¶
CanControl returns true if the player can be controlled, false otherwise. See https://github.com/popcornmix/omxplayer#cancontrol for more details.
func (*Player) CanGoNext ¶
CanGoNext returns true if the player can skip to the next track, false otherwise. See https://github.com/popcornmix/omxplayer#cangonext for more details.
func (*Player) CanGoPrevious ¶
CanGoPrevious returns true if the player can skip to previous track, false otherwise. See https://github.com/popcornmix/omxplayer#cangoprevious for more details.
func (*Player) CanPause ¶
CanPause returns true if the player can pause, false otherwise. See https://github.com/popcornmix/omxplayer#canpause for more details.
func (*Player) CanPlay ¶
CanPlay returns true if the player can play, false otherwise. See https://github.com/popcornmix/omxplayer#canplay for more details.
func (*Player) CanQuit ¶
CanQuit returns true if the player can quit, false otherwise. See https://github.com/popcornmix/omxplayer#canquit for more details.
func (*Player) CanRaise ¶
CanRaise returns true if the player can be brought to the front, false otherwise. See https://github.com/popcornmix/omxplayer#canraise for more details.
func (*Player) CanSeek ¶
CanSeek returns true if the player can seek, false otherwise. See https://github.com/popcornmix/omxplayer#canseek for more details.
func (*Player) CanSetFullscreen ¶
CanSetFullscreen returns true if the player can be set to fullscreen, false otherwise. See https://github.com/popcornmix/omxplayer#cansetfullscreen for more details.
func (*Player) Duration ¶
Duration returns the total length of the video in milliseconds. See https://github.com/popcornmix/omxplayer#duration for more details.
func (*Player) Fullscreen ¶
Fullscreen returns true if the player is fullscreen, false otherwise. See https://github.com/popcornmix/omxplayer#fullscreen for more details.
func (*Player) HasTrackList ¶
HasTrackList returns true if the player has a track list, false otherwise. See https://github.com/popcornmix/omxplayer#hastracklist for more details.
func (*Player) HideSubtitles ¶
HideSubtitles stops displaying subtitles. See https://github.com/popcornmix/omxplayer#hidesubtitles for more details.
func (*Player) HideVideo ¶
HideVideo is an undocumented D-Bus method. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L457.
func (*Player) Identity ¶
Identity returns the name of the player instance. See https://github.com/popcornmix/omxplayer#identity for more details.
func (*Player) IsReady ¶
IsReady checks to see if the Player instance is ready to accept D-Bus commands. If the player is ready and can accept commands, the function returns true, otherwise it returns false.
func (*Player) IsRunning ¶
IsRunning checks to see if the OMXPlayer process is running. If it is, the function returns true, otherwise it returns false.
func (*Player) ListAudio ¶
ListAudio returns a list of the audio tracks available in the video file. See https://github.com/popcornmix/omxplayer#listaudio for more details.
func (*Player) ListSubtitles ¶
ListSubtitles returns a list of the subtitles available in the video file. See https://github.com/popcornmix/omxplayer#listsubtitles for more details.
func (*Player) ListVideo ¶
ListVideo returns a list of the video tracks available in the video file. See https://github.com/popcornmix/omxplayer#listvideo for more details.
func (*Player) MaximumRate ¶
MaximumRate returns the maximum playback rate. See https://github.com/popcornmix/omxplayer#maximumrate for more details.
func (*Player) MinimumRate ¶
MinimumRate returns the minimum playback rate. See https://github.com/popcornmix/omxplayer#minimumrate for more details.
func (*Player) Mute ¶
Mute mutes the video's audio stream. See https://github.com/popcornmix/omxplayer#mute for more details.
func (*Player) Next ¶
Next tells the player to skip to the next chapter. See https://github.com/popcornmix/omxplayer#next for more details.
func (*Player) Pause ¶
Pause pauses the player if it is playing. Otherwise, it resumes playback. See https://github.com/popcornmix/omxplayer#pause for more details.
func (*Player) Play ¶
Play play the video. If the video is playing, it has no effect, if it is paused it will play from current position. See https://github.com/popcornmix/omxplayer#play for more details.
func (*Player) PlayPause ¶
PlayPause pauses the player if it is playing. Otherwise, it resumes playback. See https://github.com/popcornmix/omxplayer#playpause for more details.
func (*Player) PlaybackStatus ¶
PlaybackStatus returns the current state of the player. See https://github.com/popcornmix/omxplayer#playbackstatus for more details.
func (*Player) Position ¶
Position returns the current position in the video in milliseconds. See https://github.com/popcornmix/omxplayer#position for more details.
func (*Player) Previous ¶
Previous tells the player to skip to the previous chapter. See https://github.com/popcornmix/omxplayer#previous for more details.
func (*Player) Quit ¶
Quit stops the currently playing video and terminates the omxplayer process. See https://github.com/popcornmix/omxplayer#quit for more details.
func (*Player) ResHeight ¶
ResHeight returns the height of the video. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L383.
func (*Player) ResWidth ¶
ResWidth returns the width of the video. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L376.
func (*Player) Seek ¶
Seek performs a relative seek from the current video position. See https://github.com/popcornmix/omxplayer#seek for more details.
func (*Player) SelectAudio ¶
SelectAudio specifies which audio track should be used. See https://github.com/popcornmix/omxplayer#selectaudio for more details.
func (*Player) SelectSubtitle ¶
SelectSubtitle specifies which subtitle track should be used. See https://github.com/popcornmix/omxplayer#selectsubtitle for more details.
func (*Player) SetPosition ¶
SetPosition performs an absolute seek to the specified video position. See https://github.com/popcornmix/omxplayer#setposition for more details.
func (*Player) ShowSubtitles ¶
ShowSubtitles starts displaying subtitles. See https://github.com/popcornmix/omxplayer#showsubtitles for more details.
func (*Player) Stop ¶
Stop tells the player to stop playing the video. See https://github.com/popcornmix/omxplayer#stop for more details.
func (*Player) SupportedMimeTypes ¶
SupportedMimeTypes returns a list of supported MIME types. See https://github.com/popcornmix/omxplayer#supportedmimetypes for more details.
func (*Player) SupportedURISchemes ¶
SupportedURISchemes returns a list of playable URI formats. See https://github.com/popcornmix/omxplayer#supportedurischemes for more details.
func (*Player) UnHideVideo ¶
UnHideVideo is an undocumented D-Bus method. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L462.
func (*Player) Unmute ¶
Unmute unmutes the video's audio stream. See https://github.com/popcornmix/omxplayer#unmute for more details.
func (*Player) VideoStreamCount ¶
VideoStreamCount returns the number of available video streams. See https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp#L369.
func (*Player) Volume ¶
Volume returns the current volume. Sets a new volume when an argument is specified. See https://github.com/popcornmix/omxplayer#volume for more details.
func (*Player) Wait ¶
Wait blocks till the running omxplayer instance ends and sends a signal through the supplied channel. This is just so we know exactly when omxplayer exits, mostly so we can tell when the video it was playing ended without having to Poll IsRunning().
func (*Player) WaitForReady ¶
func (p *Player) WaitForReady()
WaitForReady waits until the Player instance is ready to accept D-Bus commands and then returns.