diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-20 16:09:38 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-21 22:09:45 +0100 |
commit | cf02fbfb17f9e04312f771f245778d31bc1b69d2 (patch) | |
tree | ffffcc63bb328be864a1f0b7ffd6a70448afc9a0 /client/src/app/videos/video-watch/video-watch.component.ts | |
parent | 900f0d2b3cc5035568ffa0853101a12c6abcffdc (diff) | |
download | PeerTube-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-watch.component.ts')
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.ts | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index 3dab2bbb7..afc6fe01c 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts | |||
@@ -1,10 +1,11 @@ | |||
1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; | 1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; |
2 | import { ActivatedRoute } from '@angular/router'; | 2 | import { ActivatedRoute } from '@angular/router'; |
3 | 3 | ||
4 | import { ModalDirective } from 'ng2-bootstrap/components/modal'; | ||
5 | import { MetaService } from 'ng2-meta'; | 4 | import { MetaService } from 'ng2-meta'; |
6 | import * as videojs from 'video.js'; | 5 | import * as videojs from 'video.js'; |
7 | 6 | ||
7 | import { VideoMagnetComponent } from './video-magnet.component'; | ||
8 | import { VideoShareComponent } from './video-share.component'; | ||
8 | import { Video, VideoService } from '../shared'; | 9 | import { Video, VideoService } from '../shared'; |
9 | import { WebTorrentService } from './webtorrent.service'; | 10 | import { WebTorrentService } from './webtorrent.service'; |
10 | 11 | ||
@@ -17,8 +18,8 @@ import { WebTorrentService } from './webtorrent.service'; | |||
17 | export class VideoWatchComponent implements OnInit, OnDestroy { | 18 | export class VideoWatchComponent implements OnInit, OnDestroy { |
18 | private static LOADTIME_TOO_LONG: number = 30000; | 19 | private static LOADTIME_TOO_LONG: number = 30000; |
19 | 20 | ||
20 | @ViewChild('magnetUriModal') magnetUriModal: ModalDirective; | 21 | @ViewChild('videoMagnetModal') videoMagnetModal: VideoMagnetComponent; |
21 | @ViewChild('shareModal') shareModal: ModalDirective; | 22 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent; |
22 | 23 | ||
23 | downloadSpeed: number; | 24 | downloadSpeed: number; |
24 | error: boolean = false; | 25 | error: boolean = false; |
@@ -121,31 +122,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
121 | }); | 122 | }); |
122 | } | 123 | } |
123 | 124 | ||
124 | showMagnetUriModal() { | ||
125 | this.magnetUriModal.show(); | ||
126 | } | ||
127 | |||
128 | hideMagnetUriModal() { | ||
129 | this.magnetUriModal.hide(); | ||
130 | } | ||
131 | |||
132 | showShareModal() { | 125 | showShareModal() { |
133 | this.shareModal.show(); | 126 | this.videoShareModal.show(); |
134 | } | 127 | } |
135 | 128 | ||
136 | hideShareModal() { | 129 | showMagnetUriModal() { |
137 | this.shareModal.hide(); | 130 | this.videoMagnetModal.show(); |
138 | } | ||
139 | |||
140 | getVideoIframeCode() { | ||
141 | return '<iframe width="560" height="315" ' + | ||
142 | 'src="' + window.location.origin + '/videos/embed/' + this.video.id + '" ' + | ||
143 | 'frameborder="0" allowfullscreen>' + | ||
144 | '</iframe>'; | ||
145 | } | ||
146 | |||
147 | getVideoUrl() { | ||
148 | return window.location.href; | ||
149 | } | 131 | } |
150 | 132 | ||
151 | private loadTooLong() { | 133 | private loadTooLong() { |