merge with upsteam 93bfad5146

This commit is contained in:
sevichecc 2023-01-25 23:55:50 +08:00
parent fcdd5e5b8b
commit e1192c07c9
Signed by untrusted user who does not match committer: SevicheCC
GPG key ID: C577000000000000

View file

@ -1,22 +1,25 @@
<script lang="ts">
export let id = undefined
export let list = undefined
export let playlist = undefined
export let start = undefined
export let autoplay = false
export let disablekb = false
export let controls = true
export let id: string
export let list: boolean = undefined
export let playlist: string = undefined
export let start: string = undefined
export let autoplay: boolean = false
export let disablekb: boolean = false
export let controls: boolean = true
export let fs = true
export let loop = false
const src = `https://www.youtube.com/embed/${id}?${list ? `listType=playlist&list=${list}&` : ''}${
playlist ? `playlist=${playlist}&` : ''
}${start ? `start=${start}` : ''}${autoplay ? 'autoplay=1&' : ''}${disablekb ? 'disablekb=1&' : ''}${
controls ? '' : 'controls=0&'
}${fs ? '' : 'fs=0&'}${loop ? 'loop=1' : ''}`
const src = `https://www.youtube.com/embed/${id}?${new URLSearchParams({
...(list ? { listType: 'playlist', list }: {}),
...(playlist ? { playlist } : {}),
...(start ? { start } : {}),
disablekb: disablekb ? '1' : '0',
controls: controls ? '1' : '0',
fs: fs ? '1' : '0',
loop: loop ? '1' : '0'
}).toString()}`
</script>
<div class="relative pb-[56.25%] mb-2">
<div class="relative pb-[56.25%] mb-4">
<iframe
{src}
class="absolute w-full h-full"