aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-watch.component.ts
diff options
context:
space:
mode:
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.ts32
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 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
2import { ActivatedRoute } from '@angular/router'; 2import { ActivatedRoute } from '@angular/router';
3 3
4import { ModalDirective } from 'ng2-bootstrap/components/modal';
5import { MetaService } from 'ng2-meta'; 4import { MetaService } from 'ng2-meta';
6import * as videojs from 'video.js'; 5import * as videojs from 'video.js';
7 6
7import { VideoMagnetComponent } from './video-magnet.component';
8import { VideoShareComponent } from './video-share.component';
8import { Video, VideoService } from '../shared'; 9import { Video, VideoService } from '../shared';
9import { WebTorrentService } from './webtorrent.service'; 10import { WebTorrentService } from './webtorrent.service';
10 11
@@ -17,8 +18,8 @@ import { WebTorrentService } from './webtorrent.service';
17export class VideoWatchComponent implements OnInit, OnDestroy { 18export 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() {