Skip to content

Now it works! Multimedia Controller bindings for Windows and Node.js

Notifications You must be signed in to change notification settings

NyaomiDEV/WinPlayer-Node

Repository files navigation

WinPlayer-Node

Now featuring: Rust rewrite!

HUGE thanks to Viola for helping me learn Rust! <3

Quickstart

import winplayer, { Status, Position } from "winplayer-rs/emitter";

// in an async body
const playerManager = await winplayer();
if (playerManager) {
	playerManager.on("MediaPropertiesChanged", (status: Status) => {
		console.log(status);
	});

	playerManager.on("PlaybackInfoChanged", (status: Status) => {
		console.log(status);
	});

	playerManager.on("TimelinePropertiesChanged", (position: Position) => {
		console.log(position);
	});
}

Also please look at test.js to use the native bindings, or test-emitter.js for a comprehensive example of the events emitted by the emitter wrapper.

It is highly encouraged to use the emitter wrapper if you're in a rush, otherwise please use the bindings directly and implement your own stuff that way.