]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-watch/video-watch.component.ts
Client: add share button
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-watch / video-watch.component.ts
index 6012daa5c833cc42bd438ff4f938022195cb49a6..0ae323c9fa3736b29f61883d01838bd0a28e646a 100644 (file)
@@ -18,6 +18,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   private static LOADTIME_TOO_LONG: number = 30000;
 
   @ViewChild('magnetUriModal') magnetUriModal: ModalDirective;
+  @ViewChild('shareModal') shareModal: ModalDirective;
 
   downloadSpeed: number;
   error: boolean = false;
@@ -74,8 +75,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   }
 
   loadVideo() {
-    console.log('<iframe width="560" height="315" src="' + window.location.origin + '/videos/embed/' + this.video.id + '" frameborder="0" allowfullscreen></iframe>');
-
     // Reset the error
     this.error = false;
     // We are loading the video
@@ -116,6 +115,25 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     this.magnetUriModal.hide();
   }
 
+  showShareModal() {
+    this.shareModal.show();
+  }
+
+  hideShareModal() {
+    this.shareModal.hide();
+  }
+
+  getVideoIframeCode() {
+    return '<iframe width="560" height="315" ' +
+           'src="' + window.location.origin + '/videos/embed/' + this.video.id + '" ' +
+           'frameborder="0" allowfullscreen>' +
+           '</iframe>';
+  }
+
+  getVideoUrl() {
+    return window.location.href;
+  }
+
   private loadTooLong() {
     this.error = true;
     console.error('The video load seems to be abnormally long.');