mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
parent
9e1400f055
commit
eec7a2afa1
@ -239,7 +239,16 @@
|
|||||||
audioChunks = [];
|
audioChunks = [];
|
||||||
recording = false;
|
recording = false;
|
||||||
};
|
};
|
||||||
mediaRecorder.start();
|
|
||||||
|
try {
|
||||||
|
mediaRecorder.start();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error starting recording:', error);
|
||||||
|
toast.error($i18n.t('Error starting recording.'));
|
||||||
|
loading = false;
|
||||||
|
recording = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (transcribe) {
|
if (transcribe) {
|
||||||
if ($config.audio.stt.engine === 'web' || ($settings?.audio?.stt?.engine ?? '') === 'web') {
|
if ($config.audio.stt.engine === 'web' || ($settings?.audio?.stt?.engine ?? '') === 'web') {
|
||||||
|
@ -22,7 +22,21 @@
|
|||||||
|
|
||||||
{#if token.type === 'html'}
|
{#if token.type === 'html'}
|
||||||
{#if html && html.includes('<video')}
|
{#if html && html.includes('<video')}
|
||||||
{@html html}
|
{@const video = html.match(/<video[^>]*>([\s\S]*?)<\/video>/)}
|
||||||
|
{@const videoSrc = video && video[1]}
|
||||||
|
{#if videoSrc}
|
||||||
|
<!-- svelte-ignore a11y-media-has-caption -->
|
||||||
|
<video
|
||||||
|
class="w-full my-2"
|
||||||
|
src={videoSrc}
|
||||||
|
title="Video player"
|
||||||
|
frameborder="0"
|
||||||
|
referrerpolicy="strict-origin-when-cross-origin"
|
||||||
|
allowfullscreen
|
||||||
|
></video>
|
||||||
|
{:else}
|
||||||
|
{token.text}
|
||||||
|
{/if}
|
||||||
{:else if token.text && token.text.match(/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/)}
|
{:else if token.text && token.text.match(/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/)}
|
||||||
{@const match = token.text.match(
|
{@const match = token.text.match(
|
||||||
/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/
|
/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/
|
||||||
|
Loading…
Reference in New Issue
Block a user