From 31b6ddf86652502e0c96d77fa10861ce4af11aa4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Apr 2019 09:23:18 +0200 Subject: Add ability to disable tracker --- .../app/videos/+video-watch/video-watch.component.scss | 1 + .../app/videos/+video-watch/video-watch.component.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'client/src/app/videos/+video-watch') diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss index d61a0bc3e..84b9aed39 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.scss +++ b/client/src/app/videos/+video-watch/video-watch.component.scss @@ -427,6 +427,7 @@ my-video-comments { // If the view is not expanded, take into account the menu .privacy-concerns { width: calc(100% - #{$menu-width}); + margin-left: -15px; } @media screen and (max-width: $small-view) { 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' import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' import { ComponentPagination } from '@app/shared/rest/component-pagination.model' import { Video } from '@app/shared/video/video.model' +import { isWebRTCDisabled } from '../../../assets/player/utils' @Component({ selector: 'my-video-watch', @@ -71,6 +72,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private currentTime: number private paramsSub: Subscription private queryParamsSub: Subscription + private configSub: Subscription constructor ( private elementRef: ElementRef, @@ -100,12 +102,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } ngOnInit () { - if ( - !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false || - peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' - ) { - this.hasAlreadyAcceptedPrivacyConcern = true - } + this.configSub = this.serverService.configLoaded + .subscribe(() => { + if ( + isWebRTCDisabled() || + this.serverService.getConfig().tracker.enabled === false || + peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' + ) { + this.hasAlreadyAcceptedPrivacyConcern = true + } + }) this.paramsSub = this.route.params.subscribe(routeParams => { const videoId = routeParams[ 'videoId' ] -- cgit v1.2.3