Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't send view on private video

Chocobozzzf5a2dc48eb80
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index 24418fc4f2..66eb6611a7 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -35,7 +35,6 @@ export class VideoEditComponent implements OnInit {
schedulePublicationEnabled = false
- error: string = null
calendarLocale: any = {}
minScheduledDate = new Date()
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 72e96ca938..6f6bd4e5d5 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -10,7 +10,7 @@ import { Subscription } from 'rxjs'
import * as videojs from 'video.js'
import 'videojs-hotkeys'
import * as WebTorrent from 'webtorrent'
-import { UserVideoRateType, VideoRateType, VideoState } from '../../../../../shared'
+import { UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared'
import '../../../assets/player/peertube-videojs-plugin'
import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared'
@@ -368,7 +368,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
inactivityTimeout: 2500,
videoFiles: this.video.files,
playerElement: this.playerElement,
- videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid),
+ videoViewUrl: this.video.privacy.id !== VideoPrivacy.PRIVATE ? this.videoService.getVideoViewUrl(this.video.uuid) : null,
videoDuration: this.video.duration,
enableHotkeys: true,
peertubeLink: false,
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index fe9fc1a696..b62dcb8299 100644
--- a/client/src/assets/player/peertube-videojs-plugin.ts
+++ b/client/src/assets/player/peertube-videojs-plugin.ts
@@ -502,6 +502,8 @@ class PeerTubePlugin extends Plugin {
}
private addViewToVideo () {
+ if (!this.videoViewUrl) return Promise.resolve(undefined)
+
return fetch(this.videoViewUrl, { method: 'POST' })
}