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'
10 selector: 'my-video-share',
11 templateUrl: './video-share.component.html',
12 styleUrls: [ './video-share.component.scss' ]
14 export class VideoShareComponent {
15 @Input() video: VideoDetails = null
17 @ViewChild('modal') modal: ModalDirective
19 constructor (private notificationsService: NotificationsService) {
31 getVideoIframeCode () {
32 return buildVideoEmbed(this.video.embedUrl)
36 return window.location.href
40 return window.location.protocol === 'http:'
43 activateCopiedMessage () {
44 this.notificationsService.success('Success', 'Copied')