-
Notifications
You must be signed in to change notification settings - Fork 143
refactor: Voice Player date structure #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Voice Player date structure #414
Conversation
}).then((audioFile: File) => { | ||
const currentAudioUnit = audioStorage[groupKey] || AudioUnitDefaultValue() as AudioStorageUnit; | ||
const audioPlayer = new Audio(URL?.createObjectURL?.(audioFile)); | ||
audioPlayer.id = VOICE_PLAYER_AUDIO_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set id
of Audio element
const voicePlayerRoot = document.getElementById(VOICE_PLAYER_ROOT_ID); | ||
voicePlayerRoot.appendChild(audioPlayer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And append the Audio element to the root element
removeEventHandler, | ||
voicePlayerStore, | ||
}}> | ||
<div id={VOICE_PLAYER_ROOT_ID} style={{ display: 'none' }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the root element
const voiceAudioPlayerElement = document.getElementById(VOICE_PLAYER_AUDIO_ID); | ||
(voiceAudioPlayerElement as HTMLAudioElement)?.pause?.(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And get and use the Audio element to call pause
here
For Internal Contributors
UIKIT-3263
Description Of Changes
IDLE
status to the VoicePlayerStatusTypes Of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that apply_