aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/videos/shared/video.model.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts
index 51c5319ea..6e8dfaa6f 100644
--- a/client/src/app/videos/shared/video.model.ts
+++ b/client/src/app/videos/shared/video.model.ts
@@ -73,6 +73,12 @@ export class Video implements VideoServerModel {
73 nsfw: boolean, 73 nsfw: boolean,
74 files: VideoFile[] 74 files: VideoFile[]
75 }) { 75 }) {
76 let absoluteAPIUrl = API_URL
77 if (!absoluteAPIUrl) {
78 // The API is on the same domain
79 absoluteAPIUrl = window.location.origin
80 }
81
76 this.author = hash.author 82 this.author = hash.author
77 this.createdAt = new Date(hash.createdAt.toString()) 83 this.createdAt = new Date(hash.createdAt.toString())
78 this.categoryLabel = hash.categoryLabel 84 this.categoryLabel = hash.categoryLabel
@@ -91,11 +97,11 @@ export class Video implements VideoServerModel {
91 this.podHost = hash.podHost 97 this.podHost = hash.podHost
92 this.tags = hash.tags 98 this.tags = hash.tags
93 this.thumbnailPath = hash.thumbnailPath 99 this.thumbnailPath = hash.thumbnailPath
94 this.thumbnailUrl = API_URL + hash.thumbnailPath 100 this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath
95 this.previewPath = hash.previewPath 101 this.previewPath = hash.previewPath
96 this.previewUrl = API_URL + hash.previewPath 102 this.previewUrl = absoluteAPIUrl + hash.previewPath
97 this.embedPath = hash.embedPath 103 this.embedPath = hash.embedPath
98 this.embedUrl = API_URL + hash.embedPath 104 this.embedUrl = absoluteAPIUrl + hash.embedPath
99 this.views = hash.views 105 this.views = hash.views
100 this.likes = hash.likes 106 this.likes = hash.likes
101 this.dislikes = hash.dislikes 107 this.dislikes = hash.dislikes