add link to open video on origin instance

closes #3624
pull/3952/head
Rigel Kent 2021-04-10 16:48:13 +02:00 committed by Chocobozzz
parent 8155db669b
commit de779034cd
2 changed files with 9 additions and 2 deletions

View File

@ -232,8 +232,8 @@
</div> </div>
<div *ngIf="video.isLocal === false" class="video-attribute"> <div *ngIf="video.isLocal === false" class="video-attribute">
<span i18n class="video-attribute-label">Origin instance</span> <span i18n class="video-attribute-label">Origin</span>
<a class="video-attribute-value" target="_blank" rel="noopener noreferrer" [href]="video.originInstanceUrl">{{ video.originInstanceHost }}</a> <a class="video-attribute-value" target="_blank" rel="noopener noreferrer" [href]="getVideoUrl()">{{ video.originInstanceHost }}</a>
</div> </div>
<div *ngIf="!!video.originallyPublishedAt" class="video-attribute"> <div *ngIf="!!video.originallyPublishedAt" class="video-attribute">

View File

@ -295,6 +295,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
return this.authService.isLoggedIn() return this.authService.isLoggedIn()
} }
getVideoUrl () {
if (!this.video.url) {
return this.video.originInstanceUrl + VideoDetails.buildClientUrl(this.video.uuid)
}
return this.video.url
}
getVideoTags () { getVideoTags () {
if (!this.video || Array.isArray(this.video.tags) === false) return [] if (!this.video || Array.isArray(this.video.tags) === false) return []