1 import { Component, Input, ViewChild } from '@angular/core';
3 import { ModalDirective } from 'ng2-bootstrap/modal';
5 import { Video } from '../shared';
8 selector: 'my-video-share',
9 templateUrl: './video-share.component.html'
11 export class VideoShareComponent {
12 @Input() video: Video = null;
14 @ViewChild('modal') modal: ModalDirective;
28 getVideoIframeCode() {
29 return '<iframe width="560" height="315" ' +
30 'src="' + window.location.origin + '/videos/embed/' + this.video.id + '" ' +
31 'frameborder="0" allowfullscreen>' +
36 return window.location.href;
40 return window.location.protocol === 'http:';