🐛 (bot) Fix audio and video autoplay error catching
This commit is contained in:
@@ -21,13 +21,10 @@ export const AudioBubble = (props: Props) => {
|
||||
setIsTyping(false)
|
||||
setTimeout(() => {
|
||||
const audioElement = ref?.querySelector('audio')
|
||||
if (audioElement) {
|
||||
try {
|
||||
audioElement.play()
|
||||
} catch (e) {
|
||||
console.warn('Could not autoplay the audio:', e)
|
||||
}
|
||||
}
|
||||
if (audioElement)
|
||||
audioElement
|
||||
.play()
|
||||
.catch((e) => console.warn('Could not autoplay the audio:', e))
|
||||
props.onTransitionEnd(ref?.offsetTop)
|
||||
}, showAnimationDuration)
|
||||
}, typingDuration)
|
||||
|
||||
@@ -18,13 +18,10 @@ export const VideoBubble = (props: Props) => {
|
||||
|
||||
const onTypingEnd = () => {
|
||||
const videoElement = ref?.querySelector('video')
|
||||
if (videoElement) {
|
||||
try {
|
||||
videoElement.play()
|
||||
} catch (e) {
|
||||
console.warn('Could not autoplay the video:', e)
|
||||
}
|
||||
}
|
||||
if (videoElement)
|
||||
videoElement
|
||||
.play()
|
||||
.catch((e) => console.warn('Could not autoplay the video:', e))
|
||||
if (!isTyping()) return
|
||||
setIsTyping(false)
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user