Skip to content

Commit

Permalink
🐛 (bot) Improve canPlay issue fixin
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jul 12, 2023
1 parent 082084a commit 0b4b15c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.77",
"version": "0.0.78",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,26 @@ export const AudioBubble = (props: Props) => {
let audioElement: HTMLAudioElement | undefined
const [isTyping, setIsTyping] = createSignal(true)

const autoPlay = () => {
const autoPlay = async () => {
if (isPlayed) return
isPlayed = true
if (audioElement)
audioElement
.play()
.catch((e) => console.warn('Could not autoplay the audio:', e))
try {
if (audioElement) await audioElement.play()
} catch (e) {
console.warn('Could not autoplay the audio:', e)
}

props.onTransitionEnd(ref?.offsetTop)
}

onMount(() => {
if (audioElement)
audioElement.oncanplay = () => {
if (isPlayed) return
clearTimeout(typingTimeout)
setIsTyping(false)
setTimeout(autoPlay, showAnimationDuration)
}
typingTimeout = setTimeout(() => {
if (isPlayed) return
setIsTyping(false)
setTimeout(autoPlay, showAnimationDuration)
}, defaultTypingDuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ export const VideoBubble = (props: Props) => {
let videoElement: HTMLVideoElement | undefined
const [isTyping, setIsTyping] = createSignal(true)

const autoPlay = () => {
const autoPlay = async () => {
if (isPlayed) return
isPlayed = true
if (videoElement)
videoElement
.play()
.catch((e) => console.warn('Could not autoplay the video:', e))
try {
if (videoElement) await videoElement.play()
} catch (e) {
console.warn('Could not autoplay the video:', e)
}
props.onTransitionEnd(ref?.offsetTop)
}

onMount(() => {
if (videoElement)
videoElement.oncanplay = () => {
if (isPlayed) return
clearTimeout(typingTimeout)
setIsTyping(false)
setTimeout(autoPlay, showAnimationDuration)
}
typingTimeout = setTimeout(
() => {
if (isPlayed) return
setIsTyping(false)
setTimeout(autoPlay, showAnimationDuration)
},
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.77",
"version": "0.0.78",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

2 comments on commit 0b4b15c

@vercel
Copy link

@vercel vercel bot commented on 0b4b15c Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

stan.vselise.com
typebot.aloe.bot
voicehelp.cr8.ai
zap.fundviser.in
analistamines.com
app.bouclidom.com
app.chatforms.net
appmillion.online
bot.aldoemaria.it
bot.chatbotcv.com
bot.hostnation.de
bot.ketoolife.com
bot.maitempah.com
bot.phuonghub.com
bot.reviewzer.com
bot.rihabilita.it
bot.uluhub.com.br
cares.urlabout.me
chat.gaswadern.de
chat.gniorder.com
chat.onrentme.com
chat.rojie.online
chatwebonline.com
fmm.wpwakanda.com
footballmeetup.ie
gentleman-shop.fr
island.wakanda.is
k1.kandabrand.com
kp.pedroknoll.com
lb.ticketfute.com
ov1.wpwakanda.com
ov2.wpwakanda.com
ov3.wpwakanda.com
redeemchatgpt.com
support.triplo.ai
viewer.typebot.io
welcome.triplo.ai
1988.bouclidom.com
amancarseat.online
amostra-safe.click
andreimayer.com.br
bebesemcolicas.com
bot.danyservice.it
bot.iconicbrows.it
bot.lucide.contact
bot.neferlopez.com
bot.samplehunt.com
bot.sinalcerto.com
bot.wphelpchat.com
bots.robomotion.io
cadu.uninta.edu.br
chat.hand-made.one
chat.tuanpakya.com
chat.webisharp.com
descobrindotudo.me
dicanatural.online
digitalhelp.com.au
goalsettingbot.com
noticiasnet.online
omarcodosanjos.com
pant.maxbot.com.br
pantherview.cr8.ai
positivobra.com.br
rollingball.cr8.ai
speciallife.com.br
sub.yolozeeeer.com
survey.digienge.io
zap.techadviser.in
ai.digitaldaftar.in
app.danielnalex.com
ask.realversity.org
bot.boston-voip.com
bot.cabinpromos.com
bot.carnaval.studio
bot.digitalbled.com
bot.dsignagency.com
bot.enthrallart.com
bot.eventhub.com.au
bot.gravityatoms.in
bot.jepierre.com.br
bot.leadgenpod.site
bot.ltmidias.com.br
bot.viralsangat.com
bot.winglabs.com.br
capitaldigital.live
carsalesenquiry.com
chat-digital.online
chat.marius.digital
chat.sr7digital.com
chatbot.matthesv.de
chatbot.repplai.com
demo.botscientis.us
demo.wemakebots.xyz
feiralimpanomes.com
hrbot.robomotion.io
inearephones.cr8.ai
kbsub.wpwakanda.com
limitenahora.com.br
live.botscientis.us
mentoria.omelhor.vc

@vercel
Copy link

@vercel vercel bot commented on 0b4b15c Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app

Please sign in to comment.