Add stop button to playerbar
This commit is contained in:
parent
fed96d1fce
commit
10d7664733
2 changed files with 12 additions and 1 deletions
|
@ -12,6 +12,7 @@ import {
|
||||||
RiSkipBackFill,
|
RiSkipBackFill,
|
||||||
RiSkipForwardFill,
|
RiSkipForwardFill,
|
||||||
RiSpeedFill,
|
RiSpeedFill,
|
||||||
|
RiStopFill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Text } from '/@/renderer/components';
|
import { Text } from '/@/renderer/components';
|
||||||
|
@ -145,6 +146,15 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => {
|
||||||
<>
|
<>
|
||||||
<ControlsContainer>
|
<ControlsContainer>
|
||||||
<ButtonsContainer>
|
<ButtonsContainer>
|
||||||
|
<PlayerButton
|
||||||
|
icon={<RiStopFill size={15} />}
|
||||||
|
tooltip={{
|
||||||
|
label: 'Stop',
|
||||||
|
openDelay: 500,
|
||||||
|
}}
|
||||||
|
variant="tertiary"
|
||||||
|
onClick={handleStop}
|
||||||
|
/>
|
||||||
<PlayerButton
|
<PlayerButton
|
||||||
$isActive={shuffle !== PlayerShuffle.NONE}
|
$isActive={shuffle !== PlayerShuffle.NONE}
|
||||||
icon={<RiShuffleFill size={15} />}
|
icon={<RiShuffleFill size={15} />}
|
||||||
|
|
|
@ -116,7 +116,8 @@ export const useCenterControls = (args: { playersRef: any }) => {
|
||||||
mprisUpdateSong({ status: PlayerStatus.PAUSED });
|
mprisUpdateSong({ status: PlayerStatus.PAUSED });
|
||||||
|
|
||||||
if (isMpvPlayer) {
|
if (isMpvPlayer) {
|
||||||
mpvPlayer.stop();
|
mpvPlayer.pause();
|
||||||
|
mpvPlayer.seekTo(0);
|
||||||
} else {
|
} else {
|
||||||
stopPlayback();
|
stopPlayback();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue