this.queryParamsSub = this.route.queryParams.subscribe(async queryParams => {
const videoId = queryParams[ 'videoId' ]
- if (videoId) await this.loadVideo(videoId)
+ if (videoId) this.loadVideo(videoId)
const start = queryParams[ 'start' ]
if (this.player && start) this.player.currentTime(parseInt(start, 10))
}
canGetVideo (video: MVideoFullLight) {
- if (video.privacy === VideoPrivacy.INTERNAL) return true
+ const videoUserId = video.VideoChannel.Account.userId
- if (video.privacy === VideoPrivacy.PRIVATE) {
- return video.VideoChannel && video.VideoChannel.Account.userId === this.id
+ if (video.isBlacklisted()) {
+ return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
- if (video.isBlacklisted()) {
- return this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
+ if (video.privacy === VideoPrivacy.PRIVATE) {
+ return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
+ if (video.privacy === VideoPrivacy.INTERNAL) return true
+
return false
}