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')
dateToHuman,
immutableAssign,
objectToFormData,
+ getAbsoluteEmbedUrl,
objectLineFeedToHtml,
removeElementFromArray,
importModule,
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,
VideoScheduleUpdate,
VideoState
} from '@shared/models'
-import { environment } from '../../../../environments/environment'
import { Actor } from '../account/actor.model'
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.url
production: false,
hmr: false,
apiUrl: 'http://localhost:9001',
- embedUrl: 'http://localhost:9001/videos/embed'
+ embedUrl: 'http://localhost:9001'
}
production: false,
hmr: true,
apiUrl: '',
- embedUrl: 'http://localhost:9000/videos/embed'
+ embedUrl: 'http://localhost:9000'
}
production: true,
hmr: false,
apiUrl: '',
- embedUrl: '/videos/embed'
+ embedUrl: ''
}
production: false,
hmr: false,
apiUrl: 'http://localhost:9000',
- embedUrl: 'http://localhost:9000/videos/embed'
+ embedUrl: 'http://localhost:9000'
}