Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
/ mpv_ipc Public archive

🦕 mpv-player/mpv JSON IPC wrapper for Deno

Notifications You must be signed in to change notification settings

NextFire/mpv_ipc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpv_ipc

mpv-player/mpv JSON IPC wrapper for Deno.

Usage

The module can be imported from https://deno.land/x/mpv_ipc/mod.ts

You will need to run your scripts with the --unstable --allow-read --allow-write flags.

Example

// replace 0.1.0 with the latest tag available
import { MpvIPC } from "https://deno.land/x/mpv_ipc@0.1.0/mod.ts";

// connect to socket
// mpv file.mkv --input-ipc-server=/tmp/mpvsocket
const client = await MpvIPC.connectSocket("/tmp/mpvsocket");

// send a command and await the response
const resp1 = client.sendCommand("screenshot");
console.log(resp1);

// subscribe to specific events
const resp2 = await client.observeProperty("volume");
console.log(resp2);

// read events
for await (const event of client) {
  console.log(event);
}

About

🦕 mpv-player/mpv JSON IPC wrapper for Deno

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published