Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

mpv (remote) control library

This library provides everything needed to (remote) control the mpv media player.

It provides an easy api, a json api and rpc functionality.

Usecases: Remote control your mediaplayer running on a raspberry pi or laptop or build a http interface for mpv

Usage

$ go get github.com/blang/mpv

Note: Always vendor your dependencies or fix on a specific version tag.

Start mpv:

$ mpv --idle --input-ipc-server=/tmp/mpvsocket

Remote control:

importgithub.com/blang/mpvipcc :=mpv.NewIPCClient("/tmp/mpvsocket") // Lowlevel clientc:=mpv.NewClient(ipcc) // Highlevel client, can also use RPCClientc.LoadFile("movie.mp4", mpv.LoadFileModeReplace)
c.SetPause(true)
c.Seek(600, mpv.SeekModeAbsolute)
c.SetFullscreen(true)
c.SetPause(false)
pos, err:=c.Position()
fmt.Printf("Position in Seconds: %.0f", pos)

Also check the GoDocs.

Features

  • Low-Level and High-Level API
  • RPC Server and Client (fully transparent)
  • HTTP Handler exposing lowlevel API (json)

Contribution

Feel free to make a pull request. For bigger changes create a issue first to discuss about it.

License

See LICENSE file.

About

mpv remote control library written in golang

Topics

Resources

Stars

42 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages