diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-09 14:28:44 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-09 14:28:44 +0200 |
commit | a685e25ca05f08ad1b3f7fbaccc8744727bd8d27 (patch) | |
tree | e50fbc2f260a0017113c4668c3c0f3d2fd76ab87 /client/src/app/videos/+video-watch/video-share.component.ts | |
parent | 2ed6a0aedc2d2f6b1ac2fd9a1ac137772831f713 (diff) | |
download | PeerTube-a685e25ca05f08ad1b3f7fbaccc8744727bd8d27.tar.gz PeerTube-a685e25ca05f08ad1b3f7fbaccc8744727bd8d27.tar.zst PeerTube-a685e25ca05f08ad1b3f7fbaccc8744727bd8d27.zip |
Try to optimize frontend
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.ts | 42 |
1 files changed, 42 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..133f93498 --- /dev/null +++ b/client/src/app/videos/+video-watch/video-share.component.ts | |||
@@ -0,0 +1,42 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | ||
2 | |||
3 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
4 | |||
5 | import { Video } from '../shared' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-video-share', | ||
9 | templateUrl: './video-share.component.html' | ||
10 | }) | ||
11 | export 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.uuid + '" ' + | ||
31 | 'frameborder="0" allowfullscreen>' + | ||
32 | '</iframe>' | ||
33 | } | ||
34 | |||
35 | getVideoUrl () { | ||
36 | return window.location.href | ||
37 | } | ||
38 | |||
39 | notSecure () { | ||
40 | return window.location.protocol === 'http:' | ||
41 | } | ||
42 | } | ||