ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix embed url
Chocobozzz72493e44e9b4
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.tsindex 879f697f47..9bf22f62f9 100644--- a/client/src/app/helpers/utils.ts+++ b/client/src/app/helpers/utils.ts@@ -45,6 +45,16 @@ function getAbsoluteAPIUrl () {return absoluteAPIUrl}+function getAbsoluteEmbedUrl () {+ let absoluteEmbedUrl = environment.embedUrl+ if (!absoluteEmbedUrl) {+ // The Embed is on the same domain+ absoluteEmbedUrl = window.location.origin+ }++ return absoluteEmbedUrl+}+const datePipe = new DatePipe('en')function dateToHuman (date: string) {return datePipe.transform(date, 'medium')@@ -201,6 +211,7 @@ export {dateToHuman,immutableAssign,objectToFormData,+ getAbsoluteEmbedUrl,objectLineFeedToHtml,removeElementFromArray,importModule,diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.tsindex 3e6d6a38d6..147d0817e2 100644--- a/client/src/app/shared/shared-main/video/video.model.ts+++ b/client/src/app/shared/shared-main/video/video.model.ts@@ -1,6 +1,6 @@import { AuthUser } from '@app/core'import { User } from '@app/core/users/user.model'-import { durationToString, getAbsoluteAPIUrl } from '@app/helpers'+import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'import {Avatar,peertubeTranslate,@@ -12,7 +12,6 @@ import {VideoScheduleUpdate,VideoState} from '@shared/models'-import { environment } from '../../../../environments/environment'import { Actor } from '../account/actor.model'export class Video implements VideoServerModel {@@ -118,7 +117,7 @@ export class Video implements VideoServerModel {this.previewUrl = hash.previewUrl || (absoluteAPIUrl + hash.previewPath)this.embedPath = hash.embedPath- this.embedUrl = hash.embedUrl || (environment.embedUrl + hash.embedPath)+ this.embedUrl = hash.embedUrl || (getAbsoluteEmbedUrl() + hash.embedPath)this.url = hash.urldiff --git a/client/src/environments/environment.e2e.ts b/client/src/environments/environment.e2e.tsindex 7724d27c92..b33ff9f863 100644--- a/client/src/environments/environment.e2e.ts+++ b/client/src/environments/environment.e2e.ts@@ -2,5 +2,5 @@ export const environment = {production: false,hmr: false,apiUrl: 'http://localhost:9001',- embedUrl: 'http://localhost:9001/videos/embed'+ embedUrl: 'http://localhost:9001'}diff --git a/client/src/environments/environment.hmr.ts b/client/src/environments/environment.hmr.tsindex 72eed45e5e..3b6eff302c 100644--- a/client/src/environments/environment.hmr.ts+++ b/client/src/environments/environment.hmr.ts@@ -2,5 +2,5 @@ export const environment = {production: false,hmr: true,apiUrl: '',- embedUrl: 'http://localhost:9000/videos/embed'+ embedUrl: 'http://localhost:9000'}diff --git a/client/src/environments/environment.prod.ts b/client/src/environments/environment.prod.tsindex 368aa13899..2e9b9fefeb 100644--- a/client/src/environments/environment.prod.ts+++ b/client/src/environments/environment.prod.ts@@ -2,5 +2,5 @@ export const environment = {production: true,hmr: false,apiUrl: '',- embedUrl: '/videos/embed'+ embedUrl: ''}diff --git a/client/src/environments/environment.ts b/client/src/environments/environment.tsindex 60f5d94509..4816e30608 100644--- a/client/src/environments/environment.ts+++ b/client/src/environments/environment.ts@@ -12,5 +12,5 @@ export const environment = {production: false,hmr: false,apiUrl: 'http://localhost:9000',- embedUrl: 'http://localhost:9000/videos/embed'+ embedUrl: 'http://localhost:9000'}