]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/video-share.component.ts
Better admin tables
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / video-share.component.ts
index 133f9349809d5e0b4efbb958f055d24656aa2e0a..0664c28be553767e39df752cfb8caef2729878d2 100644 (file)
@@ -1,19 +1,21 @@
 import { Component, Input, ViewChild } from '@angular/core'
 
-import { ModalDirective } from 'ngx-bootstrap/modal'
+import { NotificationsService } from 'angular2-notifications'
 
-import { Video } from '../shared'
+import { ModalDirective } from 'ngx-bootstrap/modal'
+import { VideoDetails } from '../../shared/video/video-details.model'
 
 @Component({
   selector: 'my-video-share',
-  templateUrl: './video-share.component.html'
+  templateUrl: './video-share.component.html',
+  styleUrls: [ './video-share.component.scss' ]
 })
 export class VideoShareComponent {
-  @Input() video: Video = null
+  @Input() video: VideoDetails = null
 
   @ViewChild('modal') modal: ModalDirective
 
-  constructor () {
+  constructor (private notificationsService: NotificationsService) {
     // empty
   }
 
@@ -27,7 +29,7 @@ export class VideoShareComponent {
 
   getVideoIframeCode () {
     return '<iframe width="560" height="315" ' +
-           'src="' + window.location.origin + '/videos/embed/' + this.video.uuid + '" ' +
+           'src="' + this.video.embedUrl + '" ' +
            'frameborder="0" allowfullscreen>' +
            '</iframe>'
   }
@@ -39,4 +41,8 @@ export class VideoShareComponent {
   notSecure () {
     return window.location.protocol === 'http:'
   }
+
+  activateCopiedMessage () {
+    this.notificationsService.success('Success', 'Copied')
+  }
 }