aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-watch')
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.html19
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts14
2 files changed, 31 insertions, 2 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html
index 14947da88..d75ed3538 100644
--- a/client/src/app/videos/video-watch/video-watch.component.html
+++ b/client/src/app/videos/video-watch/video-watch.component.html
@@ -50,7 +50,7 @@
50 </div> 50 </div>
51 51
52 <div id="video-actions" class="col-md-4 text-right"> 52 <div id="video-actions" class="col-md-4 text-right">
53 <button title="Get magnet URI" id="magnet-uri" class="btn btn-default"> 53 <button title="Get magnet URI" id="magnet-uri" class="btn btn-default" (click)="showMagnetUriModal()">
54 <span class="glyphicon glyphicon-magnet"></span> Magnet 54 <span class="glyphicon glyphicon-magnet"></span> Magnet
55 </button> 55 </button>
56 </div> 56 </div>
@@ -72,3 +72,20 @@
72 </div> 72 </div>
73</div> 73</div>
74 74
75<div *ngIf="video !== null" bsModal #magnetUriModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="magnetUriModal" aria-hidden="true">
76 <div class="modal-dialog">
77 <div class="modal-content">
78
79 <div class="modal-header">
80 <button type="button" class="close" aria-label="Close" (click)="hideMagnetUriModal()">
81 <span aria-hidden="true">&times;</span>
82 </button>
83 <h4 class="modal-title">Magnet Uri</h4>
84 </div>
85
86 <div class="modal-body">
87 <input #magnetUriInput (click)="magnetUriInput.select()" type="text" class="form-control input-sm" readonly [value]="video.magnetUri" />
88 </div>
89 </div>
90 </div>
91</div>
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 9a36c17e2..736ca7d5a 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -1,6 +1,8 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit } 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';
5
4import { Video, VideoService } from '../shared'; 6import { Video, VideoService } from '../shared';
5import { WebTorrentService } from './webtorrent.service'; 7import { WebTorrentService } from './webtorrent.service';
6 8
@@ -13,6 +15,8 @@ import { WebTorrentService } from './webtorrent.service';
13export class VideoWatchComponent implements OnInit, OnDestroy { 15export class VideoWatchComponent implements OnInit, OnDestroy {
14 private static LOADTIME_TOO_LONG: number = 30000; 16 private static LOADTIME_TOO_LONG: number = 30000;
15 17
18 @ViewChild('magnetUriModal') magnetUriModal: ModalDirective;
19
16 downloadSpeed: number; 20 downloadSpeed: number;
17 error: boolean = false; 21 error: boolean = false;
18 loading: boolean = false; 22 loading: boolean = false;
@@ -87,6 +91,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
87 }); 91 });
88 } 92 }
89 93
94 showMagnetUriModal() {
95 this.magnetUriModal.show();
96 }
97
98 hideMagnetUriModal() {
99 this.magnetUriModal.hide();
100 }
101
90 private loadTooLong() { 102 private loadTooLong() {
91 this.error = true; 103 this.error = true;
92 console.error('The video load seems to be abnormally long.'); 104 console.error('The video load seems to be abnormally long.');