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'
9 selector: 'my-video-share',
10 templateUrl: './video-share.component.html',
11 styleUrls: [ './video-share.component.scss' ]
13 export class VideoShareComponent {
14 @Input() video: VideoDetails = null
16 @ViewChild('modal') modal: ModalDirective
18 constructor (private notificationsService: NotificationsService) {
30 getVideoIframeCode () {
31 return '<iframe width="560" height="315" ' +
32 'src="' + this.video.embedUrl + '" ' +
33 'frameborder="0" allowfullscreen>' +
38 return window.location.href
42 return window.location.protocol === 'http:'
45 activateCopiedMessage () {
46 this.notificationsService.success('Success', 'Copied')