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