Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e7bb991df7 | |||
| 92ab7d572c | |||
| 795a6b7290 |
@@ -1 +0,0 @@
|
|||||||
[]
|
|
||||||
@@ -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
|
||||||
@@ -172,8 +174,8 @@ export class MediaPlayer {
|
|||||||
return this.favoritesStore.getFavorites();
|
return this.favoritesStore.getFavorites();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async addFavorite(item: PlaylistItem) {
|
public async addFavorite(filename: string) {
|
||||||
return this.favoritesStore.addFavorite(item);
|
return this.favoritesStore.addFavorite(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async removeFavorite(filename: string) {
|
public async removeFavorite(filename: string) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, { useState, useRef, useEffect, ReactNode } from 'react';
|
import React, { useState, useRef, useEffect, ReactNode } from 'react';
|
||||||
import { FaPlay, FaVolumeUp, FaVolumeOff, FaHeart } from 'react-icons/fa';
|
import { FaPlay, FaVolumeUp, FaVolumeOff } from 'react-icons/fa';
|
||||||
import { getDisplayTitle, PlaylistItem } from '../api/player';
|
import { getDisplayTitle, PlaylistItem } from '../api/player';
|
||||||
|
|
||||||
export enum PlayState {
|
export enum PlayState {
|
||||||
|
|||||||
Reference in New Issue
Block a user