From 46659d01dfd51a5ff3ca389978f8a0dda1d986d9 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 7 Jun 2018 15:03:33 +0200
Subject: Fix embed view with search params

---
 client/src/standalone/videos/embed.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'client')

diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 166013226..4f6fae8aa 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -59,7 +59,8 @@ function videoFetchError (videoElement: HTMLVideoElement) {
 }
 
 const urlParts = window.location.href.split('/')
-const videoId = urlParts[urlParts.length - 1]
+const lastPart = urlParts[urlParts.length - 1]
+const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0]
 
 loadLocale(environment.apiUrl, videojs, navigator.language)
   .then(() => loadVideoInfo(videoId))
-- 
cgit v1.2.3