From: Chocobozzz Date: Thu, 7 Jun 2018 13:03:33 +0000 (+0200) Subject: Fix embed view with search params X-Git-Tag: v1.0.0-beta.8~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=46659d01dfd51a5ff3ca389978f8a0dda1d986d9;p=oweals%2Fpeertube.git Fix embed view with search params --- 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))