]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/app/videos/+video-watch/modal/video-share.component.ts
Preferably use the docker hub image
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-share.component.ts
... / ...
CommitLineData
1import { Component, Input, ViewChild } from '@angular/core'
2
3import { NotificationsService } from 'angular2-notifications'
4
5import { ModalDirective } from 'ngx-bootstrap/modal'
6import { VideoDetails } from '../../../shared/video/video-details.model'
7
8@Component({
9 selector: 'my-video-share',
10 templateUrl: './video-share.component.html',
11 styleUrls: [ './video-share.component.scss' ]
12})
13export class VideoShareComponent {
14 @Input() video: VideoDetails = null
15
16 @ViewChild('modal') modal: ModalDirective
17
18 constructor (private notificationsService: NotificationsService) {
19 // empty
20 }
21
22 show () {
23 this.modal.show()
24 }
25
26 hide () {
27 this.modal.hide()
28 }
29
30 getVideoIframeCode () {
31 return '<iframe width="560" height="315" ' +
32 'src="' + this.video.embedUrl + '" ' +
33 'frameborder="0" allowfullscreen>' +
34 '</iframe>'
35 }
36
37 getVideoUrl () {
38 return window.location.href
39 }
40
41 notSecure () {
42 return window.location.protocol === 'http:'
43 }
44
45 activateCopiedMessage () {
46 this.notificationsService.success('Success', 'Copied')
47 }
48}