-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose endpoint to get audiocast signed-url
- Loading branch information
1 parent
080f115
commit 43a8cfd
Showing
4 changed files
with
134 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script context="module"> | ||
const BLOB_BASE_URI = 'audiora/assets'; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { env } from '@env'; | ||
import Spinner from './Spinner.svelte'; | ||
export let sessionId: String; | ||
async function getSignedURL() { | ||
const blobname = `${BLOB_BASE_URI}/${sessionId}`; | ||
return fetch(`${env.API_BASE_URL}/get-signed-url?blobname=${blobname}`).then<string>((res) => { | ||
if (res.ok) return res.json(); | ||
throw new Error('Failed to get signed Audiocast URL'); | ||
}); | ||
} | ||
</script> | ||
|
||
{#await getSignedURL()} | ||
<Spinner /> | ||
{:then audioURL} | ||
<audio controls class="w-full animate-fade-in block"> | ||
<source src={audioURL} type="audio/mpeg" /> | ||
Your browser does not support the audio element. | ||
</audio> | ||
{:catch error} | ||
<div>{String(error)}</div> | ||
{/await} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters