From 6db60ba9852fc364083a79398fc8088282a3f65e Mon Sep 17 00:00:00 2001 From: Natsumi Date: Tue, 29 Mar 2022 21:31:18 +1300 Subject: [PATCH] Add YouTube shorts --- html/src/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/html/src/app.js b/html/src/app.js index 88104d7f..1401975c 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9352,9 +9352,15 @@ speechSynthesis.getVoices(); var id1 = url.pathname; var id2 = url.searchParams.get('v'); if (id1 && id1.length === 12) { + // https://youtu.be/ youtubeVideoId = id1.substring(1, 12); } + if (id1 && id1.length === 19) { + // https://www.youtube.com/shorts/ + youtubeVideoId = id1.substring(8, 19); + } if (id2 && id2.length === 11) { + // https://www.youtube.com/watch?v= youtubeVideoId = id2; } if (this.youTubeApi && youtubeVideoId) {