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.ts23
1 files changed, 19 insertions, 4 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 df5b8d02d..b3ebe3e4b 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -1,4 +1,4 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild, OnChanges } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { RedirectService } from '@app/core/routing/redirect.service' 3import { RedirectService } from '@app/core/routing/redirect.service'
4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' 4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
@@ -9,18 +9,20 @@ import { Subscription } from 'rxjs/Subscription'
9import * as videojs from 'video.js' 9import * as videojs from 'video.js'
10import 'videojs-hotkeys' 10import 'videojs-hotkeys'
11import * as WebTorrent from 'webtorrent' 11import * as WebTorrent from 'webtorrent'
12import { UserVideoRateType, VideoRateType } from '../../../../../shared' 12import { UserVideoRateType, VideoRateType, FeedFormat } from '../../../../../shared'
13import '../../../assets/player/peertube-videojs-plugin' 13import '../../../assets/player/peertube-videojs-plugin'
14import { AuthService, ConfirmService } from '../../core' 14import { AuthService, ConfirmService } from '../../core'
15import { VideoBlacklistService } from '../../shared' 15import { VideoBlacklistService } from '../../shared'
16import { Account } from '../../shared/account/account.model' 16import { Account } from '../../shared/account/account.model'
17import { VideoDetails } from '../../shared/video/video-details.model' 17import { VideoDetails } from '../../shared/video/video-details.model'
18import { VideoFeedComponent } from '../../shared/video/video-feed.component'
18import { Video } from '../../shared/video/video.model' 19import { Video } from '../../shared/video/video.model'
19import { VideoService } from '../../shared/video/video.service' 20import { VideoService } from '../../shared/video/video.service'
20import { MarkdownService } from '../shared' 21import { MarkdownService } from '../shared'
21import { VideoDownloadComponent } from './modal/video-download.component' 22import { VideoDownloadComponent } from './modal/video-download.component'
22import { VideoReportComponent } from './modal/video-report.component' 23import { VideoReportComponent } from './modal/video-report.component'
23import { VideoShareComponent } from './modal/video-share.component' 24import { VideoShareComponent } from './modal/video-share.component'
25import { environment } from '../../../environments/environment'
24import { getVideojsOptions } from '../../../assets/player/peertube-player' 26import { getVideojsOptions } from '../../../assets/player/peertube-player'
25 27
26@Component({ 28@Component({
@@ -38,6 +40,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
38 40
39 otherVideosDisplayed: Video[] = [] 41 otherVideosDisplayed: Video[] = []
40 42
43 syndicationItems = {}
44
41 player: videojs.Player 45 player: videojs.Player
42 playerElement: HTMLVideoElement 46 playerElement: HTMLVideoElement
43 userRating: UserVideoRateType = null 47 userRating: UserVideoRateType = null
@@ -98,14 +102,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
98 } 102 }
99 103
100 const uuid = routeParams['uuid'] 104 const uuid = routeParams['uuid']
101 // Video did not changed 105 // Video did not change
102 if (this.video && this.video.uuid === uuid) return 106 if (this.video && this.video.uuid === uuid) return
103 107 // Video did change
104 this.videoService.getVideo(uuid).subscribe( 108 this.videoService.getVideo(uuid).subscribe(
105 video => { 109 video => {
106 const startTime = this.route.snapshot.queryParams.start 110 const startTime = this.route.snapshot.queryParams.start
107 this.onVideoFetched(video, startTime) 111 this.onVideoFetched(video, startTime)
108 .catch(err => this.handleError(err)) 112 .catch(err => this.handleError(err))
113 this.generateSyndicationList()
109 }, 114 },
110 115
111 error => { 116 error => {
@@ -242,6 +247,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
242 return this.video.tags.join(', ') 247 return this.video.tags.join(', ')
243 } 248 }
244 249
250 generateSyndicationList () {
251 const feeds = this.videoService.getAccountFeed(
252 this.video.account.id,
253 (this.video.isLocal) ? environment.apiUrl : this.video.account.host
254 )
255 this.syndicationItems['rss 2.0'] = feeds[FeedFormat.RSS]
256 this.syndicationItems['atom 1.0'] = feeds[FeedFormat.ATOM]
257 this.syndicationItems['json 1.0'] = feeds[FeedFormat.JSON]
258 }
259
245 isVideoRemovable () { 260 isVideoRemovable () {
246 return this.video.isRemovableBy(this.authService.getUser()) 261 return this.video.isRemovableBy(this.authService.getUser())
247 } 262 }