diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-21 17:01:24 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:46 +0100 |
commit | 5a71acd2547c098657ae6e0e31e0862094585088 (patch) | |
tree | b7d9792bc99f01ef4d1f4c9dc7822a50a48f7d5f /client/src/app/shared/video/modals | |
parent | d441f2ed78c004e62766394b2437f6089f2b4ca5 (diff) | |
download | PeerTube-5a71acd2547c098657ae6e0e31e0862094585088.tar.gz PeerTube-5a71acd2547c098657ae6e0e31e0862094585088.tar.zst PeerTube-5a71acd2547c098657ae6e0e31e0862094585088.zip |
Disable webtorrent support in client
Diffstat (limited to 'client/src/app/shared/video/modals')
-rw-r--r-- | client/src/app/shared/video/modals/video-download.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/modals/video-download.component.ts | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/shared/video/modals/video-download.component.html b/client/src/app/shared/video/modals/video-download.component.html index 935d01330..3619f24e5 100644 --- a/client/src/app/shared/video/modals/video-download.component.html +++ b/client/src/app/shared/video/modals/video-download.component.html | |||
@@ -9,7 +9,7 @@ | |||
9 | <div class="input-group input-group-sm"> | 9 | <div class="input-group input-group-sm"> |
10 | <div class="input-group-prepend peertube-select-container"> | 10 | <div class="input-group-prepend peertube-select-container"> |
11 | <select [(ngModel)]="resolutionId"> | 11 | <select [(ngModel)]="resolutionId"> |
12 | <option *ngFor="let file of video?.files" [value]="file.resolution.id">{{ file.resolution.label }}</option> | 12 | <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option> |
13 | </select> | 13 | </select> |
14 | </div> | 14 | </div> |
15 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> | 15 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> |
diff --git a/client/src/app/shared/video/modals/video-download.component.ts b/client/src/app/shared/video/modals/video-download.component.ts index 4022a11e8..0e9e44de7 100644 --- a/client/src/app/shared/video/modals/video-download.component.ts +++ b/client/src/app/shared/video/modals/video-download.component.ts | |||
@@ -24,12 +24,18 @@ export class VideoDownloadComponent { | |||
24 | private i18n: I18n | 24 | private i18n: I18n |
25 | ) { } | 25 | ) { } |
26 | 26 | ||
27 | getVideoFiles () { | ||
28 | if (!this.video) return [] | ||
29 | |||
30 | return this.video.getFiles() | ||
31 | } | ||
32 | |||
27 | show (video: VideoDetails) { | 33 | show (video: VideoDetails) { |
28 | this.video = video | 34 | this.video = video |
29 | 35 | ||
30 | this.activeModal = this.modalService.open(this.modal) | 36 | this.activeModal = this.modalService.open(this.modal) |
31 | 37 | ||
32 | this.resolutionId = this.video.files[0].resolution.id | 38 | this.resolutionId = this.getVideoFiles()[0].resolution.id |
33 | } | 39 | } |
34 | 40 | ||
35 | onClose () { | 41 | onClose () { |
@@ -45,7 +51,7 @@ export class VideoDownloadComponent { | |||
45 | // HTML select send us a string, so convert it to a number | 51 | // HTML select send us a string, so convert it to a number |
46 | this.resolutionId = parseInt(this.resolutionId.toString(), 10) | 52 | this.resolutionId = parseInt(this.resolutionId.toString(), 10) |
47 | 53 | ||
48 | const file = this.video.files.find(f => f.resolution.id === this.resolutionId) | 54 | const file = this.getVideoFiles().find(f => f.resolution.id === this.resolutionId) |
49 | if (!file) { | 55 | if (!file) { |
50 | console.error('Could not find file with resolution %d.', this.resolutionId) | 56 | console.error('Could not find file with resolution %d.', this.resolutionId) |
51 | return | 57 | return |