Adds video support!

This commit is contained in:
2025-02-23 18:17:27 -08:00
parent 92ab7d572c
commit e7bb991df7

View File

@@ -33,10 +33,12 @@ export class MediaPlayer {
constructor() { constructor() {
const socketFilename = Math.random().toString(36).substring(2, 10); const socketFilename = Math.random().toString(36).substring(2, 10);
const socketPath = `/tmp/mpv-${socketFilename}`; const socketPath = `/tmp/mpv-${socketFilename}`;
const enableVideo = process.env.ENABLE_VIDEO || false;
console.log("Starting player process"); console.log("Starting player process (video: " + (enableVideo ? "enabled" : "disabled") + ")");
this.playerProcess = spawn("mpv", [ this.playerProcess = spawn("mpv", [
"--no-video", "--video=" + (enableVideo ? "auto" : "no"),
"--fullscreen",
"--no-terminal", "--no-terminal",
"--idle=yes", "--idle=yes",
"--input-ipc-server=" + socketPath "--input-ipc-server=" + socketPath