diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-11-27 19:19:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-27 19:19:36 +0000 |
commit | 29b3b3db307cdc6181744db18ce4d73540d63216 (patch) | |
tree | ddadf03667b20d9142afc5e4e7b8807299c0356e /bskyweb | |
parent | 47cbdfecb382b6d64dd55f61490f5ebd599caf1d (diff) | |
download | voidsky-29b3b3db307cdc6181744db18ce4d73540d63216.tar.zst |
YT embed tweak (#6789)
* tweak css * fix typo * More tweak --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'bskyweb')
-rw-r--r-- | bskyweb/static/iframe/youtube.html | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bskyweb/static/iframe/youtube.html b/bskyweb/static/iframe/youtube.html index 4b74d6fcd..a717a67c6 100644 --- a/bskyweb/static/iframe/youtube.html +++ b/bskyweb/static/iframe/youtube.html @@ -27,13 +27,21 @@ let player function onYouTubeIframeAPIReady() { + let videoId = url.searchParams.get('videoId') + videoId = decodeURIComponent(videoId) + videoId = videoId.replace(/[^a-zA-Z0-9_-]/g, "") + if (videoId.length !== 11) throw new Error("Invalid video ID") + + let start = url.searchParams.get('start') + start = start.replace(/[^0-9]/g, "") + player = new YT.Player('player', { width: "1000", height: "1000", - videoId: url.searchParams.get('videoId'), + videoId, playerVars: { autoplay: 1, - start: url.searchParams.get('start'), + start, rel: 0, loop: 0, playsinline: 1, |