mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
fix web player playback
- add missing forwardRef on AudioPlayer component - bump react-player to latest
This commit is contained in:
parent
6525a8a725
commit
daee582e92
3 changed files with 34 additions and 17 deletions
|
|
@ -3,8 +3,16 @@ import type { CrossfadeStyle } from '/@/shared/types/types';
|
|||
import type { ReactPlayerProps } from 'react-player';
|
||||
|
||||
import isElectron from 'is-electron';
|
||||
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
||||
import ReactPlayer from 'react-player/lazy';
|
||||
import {
|
||||
forwardRef,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import ReactPlayer from 'react-player';
|
||||
|
||||
import { api } from '/@/renderer/api';
|
||||
import {
|
||||
|
|
@ -87,7 +95,12 @@ const useSongUrl = (transcode: TranscodingConfig, current: boolean, song?: Song)
|
|||
}, [current, song?.uniqueId, song?.serverId, song?.streamUrl, transcode]);
|
||||
};
|
||||
|
||||
export const AudioPlayer = ({ ref, ...props }: AudioPlayerProps) => {
|
||||
export interface AudioPlayerRef {
|
||||
player1: null | ReactPlayer;
|
||||
player2: null | ReactPlayer;
|
||||
}
|
||||
|
||||
export const AudioPlayer = forwardRef<AudioPlayerRef, AudioPlayerProps>((props, ref) => {
|
||||
const {
|
||||
autoNext,
|
||||
crossfadeDuration,
|
||||
|
|
@ -443,4 +456,4 @@ export const AudioPlayer = ({ ref, ...props }: AudioPlayerProps) => {
|
|||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue