Add stop button to playerbar

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