From 49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Nov 2016 20:03:04 +0100 Subject: 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). --- client/src/app/videos/shared/video.model.ts | 21 ++++++--------------- .../videos/video-watch/video-watch.component.html | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) (limited to 'client/src/app/videos') 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 { isLocal: boolean; magnetUri: string; name: string; - podUrl: string; + podHost: string; tags: string[]; thumbnailPath: string; - private static createByString(author: string, podUrl: string) { - let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':'); - - if (port === '80' || port === '443') { - port = ''; - } else { - port = ':' + port; - } - - - return author + '@' + host + port; + private static createByString(author: string, podHost: string) { + return author + '@' + podHost; } private static createDurationString(duration: number) { @@ -43,7 +34,7 @@ export class Video { isLocal: boolean, magnetUri: string, name: string, - podUrl: string, + podHost: string, tags: string[], thumbnailPath: string }) { @@ -55,11 +46,11 @@ export class Video { this.isLocal = hash.isLocal; this.magnetUri = hash.magnetUri; this.name = hash.name; - this.podUrl = hash.podUrl; + this.podHost = hash.podHost; this.tags = hash.tags; this.thumbnailPath = hash.thumbnailPath; - this.by = Video.createByString(hash.author, hash.podUrl); + this.by = Video.createByString(hash.author, hash.podHost); } isRemovableBy(user) { 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 f3a416367..cb91bae7e 100644 --- a/client/src/app/videos/video-watch/video-watch.component.html +++ b/client/src/app/videos/video-watch/video-watch.component.html @@ -2,7 +2,7 @@
The video load seems to be abnormally long.