From b520ee2005a26366fd4dd87e6a4261c23ad37303 Mon Sep 17 00:00:00 2001 From: MuhammadUmer44 Date: Wed, 17 Apr 2024 09:10:32 +0500 Subject: [PATCH 1/3] fix(play-and-pause): fix play and pause functionality with tapping and space button --- .../SidebarSubView/MediaPlayer/index.tsx | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/components/App/SideBar/SidebarSubView/MediaPlayer/index.tsx b/src/components/App/SideBar/SidebarSubView/MediaPlayer/index.tsx index 0c652635b..772df2413 100644 --- a/src/components/App/SideBar/SidebarSubView/MediaPlayer/index.tsx +++ b/src/components/App/SideBar/SidebarSubView/MediaPlayer/index.tsx @@ -140,6 +140,9 @@ const MediaPlayerComponent: FC = ({ hidden }) => { if (isFullScreen && event.key === 'Escape') { event.preventDefault() event.stopPropagation() + } else if (event.key === ' ') { + event.preventDefault() + togglePlay() } } @@ -152,27 +155,33 @@ const MediaPlayerComponent: FC = ({ hidden }) => { } }) + const handlePlayerClick = () => { + togglePlay() + } + return playingNode?.link ? (