<a
i18n-title title="Open the video on the origin instance" class="glyphicon glyphicon-new-window"
- target="_blank" rel="noopener noreferrer" [href]="getVideoUrl()"
+ target="_blank" rel="noopener noreferrer" [href]="video.url"
></a>
</div>
export class VideoAttributesComponent {
@Input() video: VideoDetails
- getVideoUrl () {
- if (!this.video.url) {
- return this.video.originInstanceUrl + VideoDetails.buildWatchUrl(this.video)
- }
-
- return this.video.url
- }
-
getVideoHost () {
return this.video.channel.host
}
embedPath: string
embedUrl: string
- url?: string
+ url: string
views: number
likes: number
}
getVideoUrl () {
- const baseUrl = this.customizations.originUrl
- ? this.video.originInstanceUrl
- : window.location.origin
+ const url = this.customizations.originUrl
+ ? this.video.url
+ : buildVideoLink(this.video, window.location.origin)
return decorateVideoLink({
- url: buildVideoLink(this.video, baseUrl),
+ url,
...this.getVideoOptions()
})
uuid: video.uuid,
shortUUID: uuidToShort(video.uuid),
+ url: video.url,
+
name: video.name,
category: {
id: video.category,
channel: {
displayName: string
name: string
- description
+ description: string
isLocal: boolean
}
fixture: string
expect(video.dislikes).to.equal(attributes.dislikes)
expect(video.isLocal).to.equal(attributes.isLocal)
expect(video.duration).to.equal(attributes.duration)
+ expect(video.url).to.contain(originHost)
expect(dateIsValid(video.createdAt)).to.be.true
expect(dateIsValid(video.publishedAt)).to.be.true
expect(dateIsValid(video.updatedAt)).to.be.true
embedPath: string
embedUrl?: string
- // When using the search index
- url?: string
+ url: string
views: number
likes: number