]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/videos/+video-watch/modal/video-share.component.ts
replace fs by fs-extra to prevent EMFILE error
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-share.component.ts
CommitLineData
63347a0f 1import { Component, ElementRef, Input, ViewChild } from '@angular/core'
c7e1e432 2import { NotificationsService } from 'angular2-notifications'
4635f59d 3import { VideoDetails } from '../../../shared/video/video-details.model'
960a11e8 4import { buildVideoEmbed } from '../../../../assets/player/utils'
b1d40cff 5import { I18n } from '@ngx-translate/i18n-polyfill'
63347a0f 6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
cf02fbfb
C
7
8@Component({
9 selector: 'my-video-share',
c7e1e432
JL
10 templateUrl: './video-share.component.html',
11 styleUrls: [ './video-share.component.scss' ]
cf02fbfb
C
12})
13export class VideoShareComponent {
404b54e1 14 @Input() video: VideoDetails = null
cf02fbfb 15
63347a0f 16 @ViewChild('modal') modal: ElementRef
cf02fbfb 17
b1d40cff 18 constructor (
63347a0f 19 private modalService: NgbModal,
b1d40cff
C
20 private notificationsService: NotificationsService,
21 private i18n: I18n
22 ) {
cf02fbfb
C
23 // empty
24 }
25
df98563e 26 show () {
63347a0f 27 this.modalService.open(this.modal)
cf02fbfb
C
28 }
29
df98563e 30 getVideoIframeCode () {
960a11e8 31 return buildVideoEmbed(this.video.embedUrl)
cf02fbfb
C
32 }
33
df98563e
C
34 getVideoUrl () {
35 return window.location.href
cf02fbfb 36 }
2c8d4697 37
df98563e
C
38 notSecure () {
39 return window.location.protocol === 'http:'
2c8d4697 40 }
c7e1e432
JL
41
42 activateCopiedMessage () {
b1d40cff 43 this.notificationsService.success(this.i18n('Success'), this.i18n('Copied'))
c7e1e432 44 }
cf02fbfb 45}