]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { Component, Input, ViewChild } from '@angular/core' |
df98563e | 2 | import { ModalDirective } from 'ngx-bootstrap/modal' |
202f6b6c | 3 | import { VideoDetails } from '../../shared/video/video-details.model' |
cf02fbfb C |
4 | |
5 | @Component({ | |
6 | selector: 'my-video-share', | |
7 | templateUrl: './video-share.component.html' | |
8 | }) | |
9 | export class VideoShareComponent { | |
404b54e1 | 10 | @Input() video: VideoDetails = null |
cf02fbfb | 11 | |
df98563e | 12 | @ViewChild('modal') modal: ModalDirective |
cf02fbfb | 13 | |
df98563e | 14 | constructor () { |
cf02fbfb C |
15 | // empty |
16 | } | |
17 | ||
df98563e C |
18 | show () { |
19 | this.modal.show() | |
cf02fbfb C |
20 | } |
21 | ||
df98563e C |
22 | hide () { |
23 | this.modal.hide() | |
cf02fbfb C |
24 | } |
25 | ||
df98563e | 26 | getVideoIframeCode () { |
cf02fbfb | 27 | return '<iframe width="560" height="315" ' + |
d8755eed | 28 | 'src="' + this.video.embedUrl + '" ' + |
cf02fbfb | 29 | 'frameborder="0" allowfullscreen>' + |
df98563e | 30 | '</iframe>' |
cf02fbfb C |
31 | } |
32 | ||
df98563e C |
33 | getVideoUrl () { |
34 | return window.location.href | |
cf02fbfb | 35 | } |
2c8d4697 | 36 | |
df98563e C |
37 | notSecure () { |
38 | return window.location.protocol === 'http:' | |
2c8d4697 | 39 | } |
cf02fbfb | 40 | } |