diff options
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.ts | 18 |
1 files changed, 12 insertions, 6 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 edc546b28..bce652210 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -29,6 +29,7 @@ import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | |||
29 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | 29 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' |
30 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 30 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' |
31 | import { Video } from '@app/shared/video/video.model' | 31 | import { Video } from '@app/shared/video/video.model' |
32 | import { isWebRTCDisabled } from '../../../assets/player/utils' | ||
32 | 33 | ||
33 | @Component({ | 34 | @Component({ |
34 | selector: 'my-video-watch', | 35 | selector: 'my-video-watch', |
@@ -71,6 +72,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
71 | private currentTime: number | 72 | private currentTime: number |
72 | private paramsSub: Subscription | 73 | private paramsSub: Subscription |
73 | private queryParamsSub: Subscription | 74 | private queryParamsSub: Subscription |
75 | private configSub: Subscription | ||
74 | 76 | ||
75 | constructor ( | 77 | constructor ( |
76 | private elementRef: ElementRef, | 78 | private elementRef: ElementRef, |
@@ -100,12 +102,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
100 | } | 102 | } |
101 | 103 | ||
102 | ngOnInit () { | 104 | ngOnInit () { |
103 | if ( | 105 | this.configSub = this.serverService.configLoaded |
104 | !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false || | 106 | .subscribe(() => { |
105 | peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' | 107 | if ( |
106 | ) { | 108 | isWebRTCDisabled() || |
107 | this.hasAlreadyAcceptedPrivacyConcern = true | 109 | this.serverService.getConfig().tracker.enabled === false || |
108 | } | 110 | peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' |
111 | ) { | ||
112 | this.hasAlreadyAcceptedPrivacyConcern = true | ||
113 | } | ||
114 | }) | ||
109 | 115 | ||
110 | this.paramsSub = this.route.params.subscribe(routeParams => { | 116 | this.paramsSub = this.route.params.subscribe(routeParams => { |
111 | const videoId = routeParams[ 'videoId' ] | 117 | const videoId = routeParams[ 'videoId' ] |