aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/video-watch.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-watch.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts35
1 files changed, 19 insertions, 16 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 540b568ed..51d486ea5 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -28,7 +28,15 @@ import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/sha
28import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 28import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
29import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 29import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
30import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 30import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
31import { PeerTubeProblemDocument, ServerConfig, ServerErrorCode, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' 31import {
32 HTMLServerConfig,
33 PeerTubeProblemDocument,
34 ServerErrorCode,
35 UserVideoRateType,
36 VideoCaption,
37 VideoPrivacy,
38 VideoState
39} from '@shared/models'
32import { 40import {
33 cleanupVideoWatch, 41 cleanupVideoWatch,
34 getStoredP2PEnabled, 42 getStoredP2PEnabled,
@@ -116,7 +124,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
116 private configSub: Subscription 124 private configSub: Subscription
117 private liveVideosSub: Subscription 125 private liveVideosSub: Subscription
118 126
119 private serverConfig: ServerConfig 127 private serverConfig: HTMLServerConfig
120 128
121 constructor ( 129 constructor (
122 private elementRef: ElementRef, 130 private elementRef: ElementRef,
@@ -163,21 +171,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
163 171
164 PeertubePlayerManager.initState() 172 PeertubePlayerManager.initState()
165 173
166 this.serverConfig = this.serverService.getTmpConfig() 174 this.serverConfig = this.serverService.getHTMLConfig()
167 175 if (
168 this.configSub = this.serverService.getConfig() 176 isWebRTCDisabled() ||
169 .subscribe(config => { 177 this.serverConfig.tracker.enabled === false ||
170 this.serverConfig = config 178 getStoredP2PEnabled() === false ||
179 peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
180 ) {
181 this.hasAlreadyAcceptedPrivacyConcern = true
182 }
171 183
172 if (
173 isWebRTCDisabled() ||
174 this.serverConfig.tracker.enabled === false ||
175 getStoredP2PEnabled() === false ||
176 peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
177 ) {
178 this.hasAlreadyAcceptedPrivacyConcern = true
179 }
180 })
181 184
182 this.paramsSub = this.route.params.subscribe(routeParams => { 185 this.paramsSub = this.route.params.subscribe(routeParams => {
183 const videoId = routeParams[ 'videoId' ] 186 const videoId = routeParams[ 'videoId' ]