Fixed audio api endpoint, media player mostly functional
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import SearchBar from '$lib/components/util/searchBar.svelte'
|
||||
import type { LayoutData } from './$types'
|
||||
import { currentlyPlaying } from '$lib/stores'
|
||||
import NavTab from '$lib/components/navbar/navTab.svelte'
|
||||
import PlaylistTab from '$lib/components/navbar/playlistTab.svelte'
|
||||
import MediaPlayer from '$lib/components/media/mediaPlayer.svelte'
|
||||
@@ -46,8 +45,6 @@
|
||||
<slot />
|
||||
</section>
|
||||
<section class="absolute bottom-0 z-40 grid max-h-full w-full place-items-center">
|
||||
{#if $currentlyPlaying}
|
||||
<MediaPlayer song={$currentlyPlaying} />
|
||||
{/if}
|
||||
<MediaPlayer />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { currentlyPlaying } from '$lib/stores'
|
||||
import type { PageServerData } from './$types'
|
||||
|
||||
export let data: PageServerData
|
||||
@@ -7,7 +8,12 @@
|
||||
{#if data.searchResults}
|
||||
{#await data.searchResults then searchResults}
|
||||
{#each searchResults as searchResult}
|
||||
<div>{searchResult.name} - {searchResult.type}</div>
|
||||
<button
|
||||
on:click={() => {
|
||||
if (searchResult.type === 'song') $currentlyPlaying = searchResult
|
||||
}}
|
||||
class="block bg-neutral-925">{searchResult.name} - {searchResult.type}</button
|
||||
>
|
||||
{/each}
|
||||
{/await}
|
||||
{/if}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="relative aspect-square h-full p-1">
|
||||
<img src={serviceData.icon} alt="{serviceData.displayName} icon" />
|
||||
{#if 'profilePicture' in connectionInfo}
|
||||
<img src={connectionInfo.profilePicture} alt="" class="absolute bottom-0 right-0 aspect-square h-5 rounded-full" />
|
||||
<img src="/api/remoteImage?url={connectionInfo.profilePicture}" alt="" class="absolute bottom-0 right-0 aspect-square h-5 rounded-full" />
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user