Skip to content

Commit

Permalink
Recording view. fixed missing audio stop
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 committed Mar 8, 2024
1 parent d7e3187 commit e43a0f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/AudioPlayerView/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,23 @@ export const Avatar: FC<AvatarProps> = ({ type }) => {
className='pi-w-12 pi-h-12 pi-bg-gray-500 pi-rounded-xl pi-flex pi-items-center pi-justify-center pi-flex-shrink-0 pi-flex-grow-0'
>
{type === 'announcement' ? (
<FontAwesomeIcon size={isOpen ? '2xl' : 'lg'} icon={faBullhorn} />
<FontAwesomeIcon
size={isOpen ? '2xl' : 'lg'}
icon={faBullhorn}
className='pi-text-gray-50 dark:pi-text-gray-50'
/>
) : type === 'call_recording' ? (
<FontAwesomeIcon size={isOpen ? '2xl' : 'lg'} icon={faVoicemail} />
<FontAwesomeIcon
size={isOpen ? '2xl' : 'lg'}
icon={faVoicemail}
className='pi-text-gray-50 dark:pi-text-gray-50'
/>
) : (
<FontAwesomeIcon size={isOpen ? '2xl' : 'lg'} icon={faMusic} className='pi-text-gray-50 dark:pi-text-gray-50' />
<FontAwesomeIcon
size={isOpen ? '2xl' : 'lg'}
icon={faMusic}
className='pi-text-gray-50 dark:pi-text-gray-50'
/>
)}
</motion.div>
)
Expand Down
6 changes: 6 additions & 0 deletions src/components/RecorderView/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ export const Actions: FC<{}> = () => {
})

function handleSaveRecording() {
// check if the audio is playing and pause it
if (playing) {
dispatch.player.pauseAudioPlayer()
dispatch.recorder.setPlaying(false)
dispatch.recorder.setPaused(true)
}
// Dispatch the reconrding save event
dispatchRecordingSave()
// Close the Island
Expand Down

0 comments on commit e43a0f3

Please sign in to comment.