Closed grace0925 closed 2 years ago
Excellent work @grace0925 thanks for the detailed PR description. Some feedback:
Make sure you create new files as .tsx
files, we now support typescript, so let's use it.
Moving forward, use reaction functional components instead of class components and hooks. See this SO answer and this conversation.
rfce
. I saw you did that for `AudideleteAudioRecording
should also delete the file in Firebase
Closes #548 Related to #429
Overview
AudioPlay
component that is an html audio player under the hood. It takesaudioUrl
as a prop which links to a mp3 file stored on firebase.AudioRecord
component which handles audio recording, saving, deleting and rendering of theAudioPlay
component.audio
inFormDynamicInput
MentorConfig
that allows mentors to add an audio clip to their mentor profiles.bio_recording_url
inMentor
type.AudioTimer
andPulsingRedDot
.More on
AudioRecord
This component uses the
MediaRecorder
to record audio in mp3 format. The sound blob is stored on firebase as an mp3 file under the specifiedfilePath
(mentor-profile-audio
for the mentor profile audio messages). Each audio file has a name of random string of length 8.On button press, the browser asks the user for permission to use the microphone for audio recording. On confirmation, voice recording begins until the confirm button is pressed.
After the audio message is saved, the
AudioPlay
component is rendered. The delete button will reset the recorder and remove the audio file url from postgres db.TODOs/Known issues