Skip to content

Commit

Permalink
add link to open video on origin instance
Browse files Browse the repository at this point in the history
closes #3624
  • Loading branch information
rigelk authored and Chocobozzz committed Apr 12, 2021
1 parent 8155db6 commit de77903
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ <h1 class="video-info-name">{{ video.name }}</h1>
</div>

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

<div *ngIf="!!video.originallyPublishedAt" class="video-attribute">
Expand Down
7 changes: 7 additions & 0 deletions client/src/app/+videos/+video-watch/video-watch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
return this.authService.isLoggedIn()
}

getVideoUrl () {
if (!this.video.url) {
return this.video.originInstanceUrl + VideoDetails.buildClientUrl(this.video.uuid)
}
return this.video.url
}

getVideoTags () {
if (!this.video || Array.isArray(this.video.tags) === false) return []

Expand Down

0 comments on commit de77903

Please sign in to comment.