1 import { Component, Input, ViewChild } from '@angular/core'
3 import { NotificationsService } from 'angular2-notifications'
5 import { ModalDirective } from 'ngx-bootstrap/modal'
6 import { VideoDetails } from '../../../shared/video/video-details.model'
7 import { buildVideoEmbed } from '../../../../assets/player/utils'
8 import { I18n } from '@ngx-translate/i18n-polyfill'
11 selector: 'my-video-share',
12 templateUrl: './video-share.component.html',
13 styleUrls: [ './video-share.component.scss' ]
15 export class VideoShareComponent {
16 @Input() video: VideoDetails = null
18 @ViewChild('modal') modal: ModalDirective
21 private notificationsService: NotificationsService,
35 getVideoIframeCode () {
36 return buildVideoEmbed(this.video.embedUrl)
40 return window.location.href
44 return window.location.protocol === 'http:'
47 activateCopiedMessage () {
48 this.notificationsService.success(this.i18n('Success'), this.i18n('Copied'))