]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/video/modals/video-download.component.html
Add option to download subtitles in download modal
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / modals / video-download.component.html
1 <ng-template #modal let-hide="close">
2 <div class="modal-header">
3 <h4 i18n class="modal-title">Download
4 <span *ngIf="!videoCaptions" i18n>video</span>
5 <div *ngIf="videoCaptions" ngbDropdown class="d-inline-block">
6 <span id="dropdownDownloadType" ngbDropdownToggle i18n>
7 {{ type }}
8 </span>
9 <div ngbDropdownMenu aria-labelledby="dropdownDownloadType">
10 <button *ngIf="type === 'video'" (click)="switchToType('subtitles')" ngbDropdownItem i18n>subtitles</button>
11 <button *ngIf="type === 'subtitles'" (click)="switchToType('video')" ngbDropdownItem i18n>video</button>
12 </div>
13 </div>
14 </h4>
15 <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
16 </div>
17
18 <div class="modal-body">
19 <div class="form-group">
20 <div class="input-group input-group-sm">
21 <div class="input-group-prepend peertube-select-container">
22 <select *ngIf="type === 'video'" [(ngModel)]="resolutionId">
23 <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option>
24 </select>
25 <select *ngIf="type === 'subtitles'" [(ngModel)]="subtitleLanguageId">
26 <option *ngFor="let caption of videoCaptions" [value]="caption.language.id">{{ caption.language.label }}</option>
27 </select>
28 </div>
29 <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" />
30 <div class="input-group-append">
31 <button [ngxClipboard]="urlInput" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
32 <span class="glyphicon glyphicon-copy"></span>
33 </button>
34 </div>
35 </div>
36 </div>
37
38 <div class="download-type" *ngIf="type === 'video'">
39 <div class="peertube-radio-container">
40 <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct">
41 <label i18n for="download-direct">Direct download</label>
42 </div>
43
44 <div class="peertube-radio-container">
45 <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent">
46 <label i18n for="download-torrent">Torrent (.torrent file)</label>
47 </div>
48 </div>
49 </div>
50
51 <div class="modal-footer inputs">
52 <span i18n class="action-button action-button-cancel" (click)="hide()">
53 Cancel
54 </span>
55
56 <input
57 type="submit" i18n-value value="Download" class="action-button-submit"
58 (click)="download()"
59 >
60 </div>
61 </ng-template>