(audio) Add autoplay switch in settings

This commit is contained in:
Baptiste Arnaud
2023-08-07 12:20:38 +02:00
parent bd9c8eac4c
commit 037d4ce345
9 changed files with 52 additions and 37 deletions

View File

@@ -4,7 +4,7 @@ import type { AudioBubbleContent } from '@typebot.io/schemas'
import { createSignal, onCleanup, onMount } from 'solid-js'
type Props = {
url: AudioBubbleContent['url']
content: AudioBubbleContent
onTransitionEnd: (offsetTop?: number) => void
}
@@ -50,8 +50,8 @@ export const AudioBubble = (props: Props) => {
</div>
<audio
ref={audioElement}
src={props.url}
autoplay
src={props.content.url}
autoplay={props.content.isAutoplayEnabled ?? true}
class={
'z-10 text-fade-in ' +
(isTyping() ? 'opacity-0' : 'opacity-100 m-2')