Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/woodruffw/ruby-mpv

A Ruby library for controlling mpv processes.
https://github.com/woodruffw/ruby-mpv

mpv ruby ruby-gem ruby-library

Last synced: 4 months ago
JSON representation

A Ruby library for controlling mpv processes.

Lists

README

        

ruby-mpv
========

[![Gem Version](https://badge.fury.io/rb/mpv.svg)](https://badge.fury.io/rb/mpv)

A ruby library for controlling mpv processes.

### Installation

```bash
$ gem install mpv
```

### Example

For full documentation, please see the
[RubyDocs](http://www.rubydoc.info/gems/mpv/).

```ruby
# this will be called every time mpv sends an event back over the socket
def something_happened(event)
puts "look ma! a callback: #{event.to_s}"
end

session = MPV::Session.new # contains both a MPV::Server and a MPV::Client
session.callbacks << method(:something_happened)
session.get_property "pause"
session.command "get_version"
session.command "loadlist", "my_huge_playlist.txt", "append"
session.quit!
```