Fallback to web player if mpv fails to run

This commit is contained in:
jeffvli 2024-02-13 02:05:59 -08:00
parent fb08502e51
commit 9b0c9ba3ac
14 changed files with 115 additions and 70 deletions

View file

@ -19,7 +19,7 @@ import {
useVolume,
} from '/@/renderer/store';
import {
usePlayerType,
usePlaybackType,
useSettingsStore,
useSettingsStoreActions,
useTableSettings,
@ -56,7 +56,7 @@ export const PlayQueue = forwardRef(({ type }: QueueProps, ref: Ref<any>) => {
const { setAppStore } = useAppStoreActions();
const tableConfig = useTableSettings(type);
const [gridApi, setGridApi] = useState<AgGridReactType | undefined>();
const playerType = usePlayerType();
const playbackType = usePlaybackType();
const { play } = usePlayerControls();
const volume = useVolume();
const isFocused = useAppFocus();
@ -87,7 +87,7 @@ export const PlayQueue = forwardRef(({ type }: QueueProps, ref: Ref<any>) => {
status: PlayerStatus.PLAYING,
});
if (playerType === PlaybackType.LOCAL) {
if (playbackType === PlaybackType.LOCAL) {
mpvPlayer!.volume(volume);
mpvPlayer!.setQueue(playerData);
mpvPlayer!.play();
@ -111,7 +111,7 @@ export const PlayQueue = forwardRef(({ type }: QueueProps, ref: Ref<any>) => {
const playerData = reorderQueue(selectedUniqueIds as string[], e.overNode?.data?.uniqueId);
if (playerType === PlaybackType.LOCAL) {
if (playbackType === PlaybackType.LOCAL) {
mpvPlayer!.setQueueNext(playerData);
}