diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/app.component.ts | 2 | ||||
-rw-r--r-- | client/src/app/core/routing/redirect.service.ts | 6 | ||||
-rw-r--r-- | client/src/standalone/videos/embed.ts | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 6087dbf80..0bfe9f916 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -55,7 +55,7 @@ export class AppComponent implements OnInit { | |||
55 | if (e instanceof NavigationEnd) { | 55 | if (e instanceof NavigationEnd) { |
56 | const pathname = window.location.pathname | 56 | const pathname = window.location.pathname |
57 | if (!pathname || pathname === '/' || is18nPath(pathname)) { | 57 | if (!pathname || pathname === '/' || is18nPath(pathname)) { |
58 | this.redirectService.redirectToHomepage() | 58 | this.redirectService.redirectToHomepage(true) |
59 | } | 59 | } |
60 | } | 60 | } |
61 | }) | 61 | }) |
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts index b7803cce2..1881be117 100644 --- a/client/src/app/core/routing/redirect.service.ts +++ b/client/src/app/core/routing/redirect.service.ts | |||
@@ -28,10 +28,10 @@ export class RedirectService { | |||
28 | }) | 28 | }) |
29 | } | 29 | } |
30 | 30 | ||
31 | redirectToHomepage () { | 31 | redirectToHomepage (skipLocationChange = false) { |
32 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) | 32 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) |
33 | 33 | ||
34 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange: true }) | 34 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange }) |
35 | .catch(() => { | 35 | .catch(() => { |
36 | console.error( | 36 | console.error( |
37 | 'Cannot navigate to %s, resetting default route to %s.', | 37 | 'Cannot navigate to %s, resetting default route to %s.', |
@@ -40,7 +40,7 @@ export class RedirectService { | |||
40 | ) | 40 | ) |
41 | 41 | ||
42 | RedirectService.DEFAULT_ROUTE = RedirectService.INIT_DEFAULT_ROUTE | 42 | RedirectService.DEFAULT_ROUTE = RedirectService.INIT_DEFAULT_ROUTE |
43 | return this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange: true }) | 43 | return this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange }) |
44 | }) | 44 | }) |
45 | 45 | ||
46 | } | 46 | } |
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 4f6fae8aa..e28d964de 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts | |||
@@ -21,7 +21,6 @@ import * as videojs from 'video.js' | |||
21 | 21 | ||
22 | import { VideoDetails } from '../../../../shared' | 22 | import { VideoDetails } from '../../../../shared' |
23 | import { addContextMenu, getVideojsOptions, loadLocale } from '../../assets/player/peertube-player' | 23 | import { addContextMenu, getVideojsOptions, loadLocale } from '../../assets/player/peertube-player' |
24 | import { environment } from '../../environments/environment' | ||
25 | 24 | ||
26 | function getVideoUrl (id: string) { | 25 | function getVideoUrl (id: string) { |
27 | return window.location.origin + '/api/v1/videos/' + id | 26 | return window.location.origin + '/api/v1/videos/' + id |
@@ -62,7 +61,7 @@ const urlParts = window.location.href.split('/') | |||
62 | const lastPart = urlParts[urlParts.length - 1] | 61 | const lastPart = urlParts[urlParts.length - 1] |
63 | const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0] | 62 | const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0] |
64 | 63 | ||
65 | loadLocale(environment.apiUrl, videojs, navigator.language) | 64 | loadLocale(window.location.origin, videojs, navigator.language) |
66 | .then(() => loadVideoInfo(videoId)) | 65 | .then(() => loadVideoInfo(videoId)) |
67 | .then(async response => { | 66 | .then(async response => { |
68 | const videoContainerId = 'video-container' | 67 | const videoContainerId = 'video-container' |