]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/video-watch.component.ts
Added a "previous" button on player when watching playlist
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.ts
index 0c0eaaa78d857a930c406c7a906c863ed198da63..1f24c898e31965054dfd54e2322ecbbb5d5a49b4 100644 (file)
@@ -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 []
 
@@ -792,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,