Design video update
[oweals/peertube.git] / client / src / app / videos / +video-watch / video-share.component.ts
1 import { Component, Input, ViewChild } from '@angular/core'
2 import { ModalDirective } from 'ngx-bootstrap/modal'
3 import { VideoDetails } from '../../shared/video/video-details.model'
4
5 @Component({
6   selector: 'my-video-share',
7   templateUrl: './video-share.component.html'
8 })
9 export class VideoShareComponent {
10   @Input() video: VideoDetails = null
11
12   @ViewChild('modal') modal: ModalDirective
13
14   constructor () {
15     // empty
16   }
17
18   show () {
19     this.modal.show()
20   }
21
22   hide () {
23     this.modal.hide()
24   }
25
26   getVideoIframeCode () {
27     return '<iframe width="560" height="315" ' +
28            'src="' + this.video.embedUrl + '" ' +
29            'frameborder="0" allowfullscreen>' +
30            '</iframe>'
31   }
32
33   getVideoUrl () {
34     return window.location.href
35   }
36
37   notSecure () {
38     return window.location.protocol === 'http:'
39   }
40 }