From 6385c0cb7f773f5212a96807468988e17dba1d6d Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 15 Nov 2018 16:57:59 +0100
Subject: Fix embed video id parsing

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

(limited to 'client/src/standalone')

diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index c113c67da..7daa03f23 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -256,9 +256,8 @@ class PeerTubeEmbed {
   }
 
   private async initCore () {
-    const urlParts = window.location.href.split('/')
-    const lastPart = urlParts[ urlParts.length - 1 ]
-    const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ]
+    const urlParts = window.location.pathname.split('/')
+    const videoId = urlParts[ urlParts.length - 1 ]
 
     const [ , serverTranslations, videoResponse, captionsResponse ] = await Promise.all([
       loadLocaleInVideoJS(window.location.origin, vjs, navigator.language),
-- 
cgit v1.2.3