mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
enforce web player seek by seconds when less than 1 (#1993)
This commit is contained in:
@@ -140,9 +140,15 @@ export const WebPlayerEngine = (props: WebPlayerEngineProps) => {
|
||||
};
|
||||
},
|
||||
seekTo(seekTo: number) {
|
||||
let type: 'fraction' | 'seconds' | undefined = undefined;
|
||||
|
||||
if (seekTo < 1) {
|
||||
type = 'seconds';
|
||||
}
|
||||
|
||||
playerNum === 1
|
||||
? player1Ref.current?.seekTo(seekTo)
|
||||
: player2Ref.current?.seekTo(seekTo);
|
||||
? player1Ref.current?.seekTo(seekTo, type)
|
||||
: player2Ref.current?.seekTo(seekTo, type);
|
||||
},
|
||||
setVolume(volume: number) {
|
||||
setInternalVolume1(volume / 100 || 0);
|
||||
|
||||
@@ -240,10 +240,16 @@ export function WebPlayer() {
|
||||
}
|
||||
}
|
||||
|
||||
let type: 'fraction' | 'seconds' | undefined = undefined;
|
||||
|
||||
if (timestamp < 1) {
|
||||
type = 'seconds';
|
||||
}
|
||||
|
||||
if (num === 1) {
|
||||
playerRef.current?.player1()?.ref?.seekTo(timestamp);
|
||||
playerRef.current?.player1()?.ref?.seekTo(timestamp, type);
|
||||
} else {
|
||||
playerRef.current?.player2()?.ref?.seekTo(timestamp);
|
||||
playerRef.current?.player2()?.ref?.seekTo(timestamp, type);
|
||||
}
|
||||
},
|
||||
onPlayerStatus: async (properties) => {
|
||||
|
||||
Reference in New Issue
Block a user