X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-watch%2Fvideo-watch.component.ts;h=1f24c898e31965054dfd54e2322ecbbb5d5a49b4;hb=33d21a9b47b983ee7a5c5ba6d8a416c35fe66cf9;hp=de5fb4ed0c0c88866cc5d803697bea82e8c72ce2;hpb=dc48fdbe68e9dd3a3a6028181e61d8595d98e654;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 de5fb4ed0..1f24c898e 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -295,6 +295,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return this.authService.isLoggedIn() } + getVideoUrl () { + if (!this.video.url) { + return this.video.originInstanceUrl + VideoDetails.buildClientUrl(this.video.uuid) + } + return this.video.url + } + getVideoTags () { if (!this.video || Array.isArray(this.video.tags) === false) return [] @@ -565,7 +572,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.setOpenGraphTags() this.checkUserRating() - this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs }) + const hookOptions = { + videojs, + video: this.video, + playlist: this.playlist + } + this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', hookOptions) } private async buildPlayer (urlOptions: URLOptions) { @@ -787,6 +799,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { common: { autoplay: this.isAutoplay(), nextVideo: () => this.zone.run(() => this.autoplayNext()), + previousVideo: () => this.zone.run(() => { + // FIXME: Only show if this is a playlist + if (this.playlist) this.zone.run(() => this.videoWatchPlaylist.navigateToPreviousPlaylistVideo()) + }), playerElement: this.playerElement, onPlayerElementChange: (element: HTMLVideoElement) => this.playerElement = element,