aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-watch.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-08 21:11:57 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-08 21:11:57 +0100
commit99cc4f49483704d3786d3f745ca65c6e91a901ec (patch)
tree3a555c806b581b674509ba3987fb1329f2947ab5 /client/src/app/videos/video-watch/video-watch.component.ts
parente31f6ad6373c70481bc5dc50bcd9691ef69b2c4b (diff)
downloadPeerTube-99cc4f49483704d3786d3f745ca65c6e91a901ec.tar.gz
PeerTube-99cc4f49483704d3786d3f745ca65c6e91a901ec.tar.zst
PeerTube-99cc4f49483704d3786d3f745ca65c6e91a901ec.zip
Client: add share button
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.ts22
1 files changed, 20 insertions, 2 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 6012daa5c..0ae323c9f 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -18,6 +18,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
18 private static LOADTIME_TOO_LONG: number = 30000; 18 private static LOADTIME_TOO_LONG: number = 30000;
19 19
20 @ViewChild('magnetUriModal') magnetUriModal: ModalDirective; 20 @ViewChild('magnetUriModal') magnetUriModal: ModalDirective;
21 @ViewChild('shareModal') shareModal: ModalDirective;
21 22
22 downloadSpeed: number; 23 downloadSpeed: number;
23 error: boolean = false; 24 error: boolean = false;
@@ -74,8 +75,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
74 } 75 }
75 76
76 loadVideo() { 77 loadVideo() {
77 console.log('<iframe width="560" height="315" src="' + window.location.origin + '/videos/embed/' + this.video.id + '" frameborder="0" allowfullscreen></iframe>');
78
79 // Reset the error 78 // Reset the error
80 this.error = false; 79 this.error = false;
81 // We are loading the video 80 // We are loading the video
@@ -116,6 +115,25 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
116 this.magnetUriModal.hide(); 115 this.magnetUriModal.hide();
117 } 116 }
118 117
118 showShareModal() {
119 this.shareModal.show();
120 }
121
122 hideShareModal() {
123 this.shareModal.hide();
124 }
125
126 getVideoIframeCode() {
127 return '<iframe width="560" height="315" ' +
128 'src="' + window.location.origin + '/videos/embed/' + this.video.id + '" ' +
129 'frameborder="0" allowfullscreen>' +
130 '</iframe>';
131 }
132
133 getVideoUrl() {
134 return window.location.href;
135 }
136
119 private loadTooLong() { 137 private loadTooLong() {
120 this.error = true; 138 this.error = true;
121 console.error('The video load seems to be abnormally long.'); 139 console.error('The video load seems to be abnormally long.');