https://github.com/blang/mpv
mpv remote control library written in golang
https://github.com/blang/mpv
media-player mpv
Last synced: 6 months ago
JSON representation
mpv remote control library written in golang
- Host: GitHub
- URL: https://github.com/blang/mpv
- Owner: blang
- License: mit
- Created: 2016-08-10T17:47:36.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-10T17:55:09.000Z (about 9 years ago)
- Last Synced: 2025-03-27T18:21:22.314Z (6 months ago)
- Topics: media-player, mpv
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 38
- Watchers: 3
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mpv (remote) control library
======This library provides everything needed to (remote) control the [mpv media player](https://mpv.io/).
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
-----```bash
$ go get github.com/blang/mpv
```
Note: Always vendor your dependencies or fix on a specific version tag.Start mpv:
```bash
$ mpv --idle --input-ipc-server=/tmp/mpvsocket
```Remote control:
```go
import github.com/blang/mpvipcc := mpv.NewIPCClient("/tmp/mpvsocket") // Lowlevel client
c := 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](http://godoc.org/github.com/blang/mpv).
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](LICENSE) file.