control

package
v0.0.0-...-863df89 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:    "control",
	Aliases: []string{"c"},
	Usage:   "Control mpv via socket",
	Subcommands: []cli.Command{
		PlayCommand,
		PauseCommand,
		StopCommand,

		volumeCommand,
		from0Command,
		seekCommand,
		statusCommand,
	},
}
View Source
var PauseCommand = cli.Command{
	Name:     "pause",
	Category: "CONTROL",
	Usage:    "Pause the current file",
	Action: func(ctx *cli.Context) error {
		c, err := mp.Connect(ctx)
		if err != nil {
			return err
		}
		return c.SetPause(!c.Paused())
	},
}
View Source
var PlayCommand = cli.Command{
	Name:     "play",
	Category: "CONTROL",
	Usage:    "Start to play the current file",
	Action: func(ctx *cli.Context) error {
		c, err := mp.Connect(ctx)
		if err != nil {
			return err
		}
		return c.Play()
	},
}
View Source
var StopCommand = cli.Command{
	Name:     "stop",
	Category: "CONTROL",
	Usage:    "Stop the current file",
	Action: func(ctx *cli.Context) error {
		c, err := mp.Connect(ctx)
		if err != nil {
			return err
		}
		return c.Stop()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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