aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-share.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-20 16:09:38 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-21 22:09:45 +0100
commitcf02fbfb17f9e04312f771f245778d31bc1b69d2 (patch)
treeffffcc63bb328be864a1f0b7ffd6a70448afc9a0 /client/src/app/videos/video-watch/video-share.component.ts
parent900f0d2b3cc5035568ffa0853101a12c6abcffdc (diff)
downloadPeerTube-cf02fbfb17f9e04312f771f245778d31bc1b69d2.tar.gz
PeerTube-cf02fbfb17f9e04312f771f245778d31bc1b69d2.tar.zst
PeerTube-cf02fbfb17f9e04312f771f245778d31bc1b69d2.zip
Client: move video watch modals in their own component
Diffstat (limited to 'client/src/app/videos/video-watch/video-share.component.ts')
-rw-r--r--client/src/app/videos/video-watch/video-share.component.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/client/src/app/videos/video-watch/video-share.component.ts b/client/src/app/videos/video-watch/video-share.component.ts
new file mode 100644
index 000000000..74b238350
--- /dev/null
+++ b/client/src/app/videos/video-watch/video-share.component.ts
@@ -0,0 +1,38 @@
1import { Component, Input, ViewChild } from '@angular/core';
2
3import { ModalDirective } from 'ng2-bootstrap/components/modal';
4
5import { Video } from '../shared';
6
7@Component({
8 selector: 'my-video-share',
9 templateUrl: './video-share.component.html'
10})
11export class VideoShareComponent {
12 @Input() video: Video = null;
13
14 @ViewChild('modal') modal: ModalDirective;
15
16 constructor() {
17 // empty
18 }
19
20 show() {
21 this.modal.show();
22 }
23
24 hide() {
25 this.modal.hide();
26 }
27
28 getVideoIframeCode() {
29 return '<iframe width="560" height="315" ' +
30 'src="' + window.location.origin + '/videos/embed/' + this.video.id + '" ' +
31 'frameborder="0" allowfullscreen>' +
32 '</iframe>';
33 }
34
35 getVideoUrl() {
36 return window.location.href;
37 }
38}