X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fvideo-watch.component.ts;h=182703cdf4d5169537f5951adb0c7b0f8e86ea3c;hb=ea5cd0fa2cdc7655ed5ecf134dedd52400837ef2;hp=ed7892a015687327ef08bb807d7ab567ac60f050;hpb=09edde4084bf2fc8914495ce7c884b3b02c7c8be;p=github%2FChocobozzz%2FPeerTube.git 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 ed7892a01..182703cdf 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -38,7 +38,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { otherVideosDisplayed: Video[] = [] - error = false + syndicationItems = {} + player: videojs.Player playerElement: HTMLVideoElement userRating: UserVideoRateType = null @@ -99,11 +100,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } const uuid = routeParams['uuid'] - // Video did not changed + // Video did not change if (this.video && this.video.uuid === uuid) return - + // Video did change this.videoService.getVideo(uuid).subscribe( - video => this.onVideoFetched(video), + video => { + const startTime = this.route.snapshot.queryParams.start + this.onVideoFetched(video, startTime) + .catch(err => this.handleError(err)) + this.generateSyndicationList() + }, error => { this.videoNotFound = true @@ -239,6 +245,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return this.video.tags.join(', ') } + generateSyndicationList () { + this.syndicationItems = this.videoService.getAccountFeedUrls(this.video.account.id) + } + isVideoRemovable () { return this.video.isRemovableBy(this.authService.getUser()) } @@ -316,9 +326,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ) } - private async onVideoFetched (video: VideoDetails) { + private async onVideoFetched (video: VideoDetails, startTime = 0) { this.video = video + // Re init attributes + this.descriptionLoading = false + this.completeDescriptionShown = false + this.updateOtherVideosDisplayed() if (this.video.isVideoNSFWForUser(this.user)) { @@ -347,7 +361,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { videoDuration: this.video.duration, enableHotkeys: true, peertubeLink: false, - poster: this.video.previewUrl + poster: this.video.previewUrl, + startTime }) const self = this