aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/shared
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-14 20:03:04 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed (patch)
tree68c59d67637a297d513e07ea96ba236a7f0cd43b /client/src/app/videos/shared
parent41b5da1d8cb41f5c49f0e0a01a54106c9a5925dd (diff)
downloadPeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.gz
PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.zst
PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.zip
Pod URL -> pod host. HTTPS is required to make friends.
Reason: in a network with mix http/https pods, https pods won't be able to play videos from http pod (insecure requests).
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r--client/src/app/videos/shared/video.model.ts21
1 files changed, 6 insertions, 15 deletions
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts
index 873c83ff1..b51a0e9de 100644
--- a/client/src/app/videos/shared/video.model.ts
+++ b/client/src/app/videos/shared/video.model.ts
@@ -8,21 +8,12 @@ export class Video {
8 isLocal: boolean; 8 isLocal: boolean;
9 magnetUri: string; 9 magnetUri: string;
10 name: string; 10 name: string;
11 podUrl: string; 11 podHost: string;
12 tags: string[]; 12 tags: string[];
13 thumbnailPath: string; 13 thumbnailPath: string;
14 14
15 private static createByString(author: string, podUrl: string) { 15 private static createByString(author: string, podHost: string) {
16 let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':'); 16 return author + '@' + podHost;
17
18 if (port === '80' || port === '443') {
19 port = '';
20 } else {
21 port = ':' + port;
22 }
23
24
25 return author + '@' + host + port;
26 } 17 }
27 18
28 private static createDurationString(duration: number) { 19 private static createDurationString(duration: number) {
@@ -43,7 +34,7 @@ export class Video {
43 isLocal: boolean, 34 isLocal: boolean,
44 magnetUri: string, 35 magnetUri: string,
45 name: string, 36 name: string,
46 podUrl: string, 37 podHost: string,
47 tags: string[], 38 tags: string[],
48 thumbnailPath: string 39 thumbnailPath: string
49 }) { 40 }) {
@@ -55,11 +46,11 @@ export class Video {
55 this.isLocal = hash.isLocal; 46 this.isLocal = hash.isLocal;
56 this.magnetUri = hash.magnetUri; 47 this.magnetUri = hash.magnetUri;
57 this.name = hash.name; 48 this.name = hash.name;
58 this.podUrl = hash.podUrl; 49 this.podHost = hash.podHost;
59 this.tags = hash.tags; 50 this.tags = hash.tags;
60 this.thumbnailPath = hash.thumbnailPath; 51 this.thumbnailPath = hash.thumbnailPath;
61 52
62 this.by = Video.createByString(hash.author, hash.podUrl); 53 this.by = Video.createByString(hash.author, hash.podHost);
63 } 54 }
64 55
65 isRemovableBy(user) { 56 isRemovableBy(user) {