mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-04-30 17:39:31 +08:00
merge with upsteam 93bfad5146
This commit is contained in:
parent
48bd5b970f
commit
89671e6b1a
1 changed files with 18 additions and 15 deletions
|
@ -1,22 +1,25 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let id = undefined
|
export let id: string
|
||||||
export let list = undefined
|
export let list: boolean = undefined
|
||||||
export let playlist = undefined
|
export let playlist: string = undefined
|
||||||
export let start = undefined
|
export let start: string = undefined
|
||||||
export let autoplay = false
|
export let autoplay: boolean = false
|
||||||
export let disablekb = false
|
export let disablekb: boolean = false
|
||||||
export let controls = true
|
export let controls: boolean = true
|
||||||
export let fs = true
|
export let fs = true
|
||||||
export let loop = false
|
export let loop = false
|
||||||
|
const src = `https://www.youtube.com/embed/${id}?${new URLSearchParams({
|
||||||
const src = `https://www.youtube.com/embed/${id}?${list ? `listType=playlist&list=${list}&` : ''}${
|
...(list ? { listType: 'playlist', list }: {}),
|
||||||
playlist ? `playlist=${playlist}&` : ''
|
...(playlist ? { playlist } : {}),
|
||||||
}${start ? `start=${start}` : ''}${autoplay ? 'autoplay=1&' : ''}${disablekb ? 'disablekb=1&' : ''}${
|
...(start ? { start } : {}),
|
||||||
controls ? '' : 'controls=0&'
|
disablekb: disablekb ? '1' : '0',
|
||||||
}${fs ? '' : 'fs=0&'}${loop ? 'loop=1' : ''}`
|
controls: controls ? '1' : '0',
|
||||||
|
fs: fs ? '1' : '0',
|
||||||
|
loop: loop ? '1' : '0'
|
||||||
|
}).toString()}`
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="relative pb-[56.25%] mb-2">
|
<div class="relative pb-[56.25%] mb-4">
|
||||||
<iframe
|
<iframe
|
||||||
{src}
|
{src}
|
||||||
class="absolute w-full h-full"
|
class="absolute w-full h-full"
|
||||||
|
|
Loading…
Reference in a new issue