🐛 (bot) Fix audio and video autoplay error catching
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.0.68",
|
||||
"version": "0.0.69",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -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(() => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.0.68",
|
||||
"version": "0.0.69",
|
||||
"description": "React library to display typebots on your website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
Reference in New Issue
Block a user