]>
Commit | Line | Data |
---|---|---|
1 | <ng-template #modal let-hide="close"> | |
2 | <div class="modal-header"> | |
3 | <h4 class="modal-title"> | |
4 | <ng-container i18n>Download</ng-container> | |
5 | ||
6 | <div *ngIf="videoCaptions" ngbDropdown class="d-inline-block ml-1"> | |
7 | <span id="dropdownDownloadType" ngbDropdownToggle> | |
8 | {{ type }} | |
9 | </span> | |
10 | <div ngbDropdownMenu aria-labelledby="dropdownDownloadType"> | |
11 | <button *ngIf="type === 'video'" (click)="switchToType('subtitles')" ngbDropdownItem i18n>subtitles</button> | |
12 | <button *ngIf="type === 'subtitles'" (click)="switchToType('video')" ngbDropdownItem i18n>video</button> | |
13 | </div> | |
14 | </div> | |
15 | </h4> | |
16 | <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon> | |
17 | </div> | |
18 | ||
19 | <div class="modal-body"> | |
20 | <div class="form-group"> | |
21 | <div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n> | |
22 | The following link contains a private token and should not be shared with anyone. | |
23 | </div> | |
24 | ||
25 | <div class="input-group input-group-sm"> | |
26 | <div class="input-group-prepend peertube-select-container"> | |
27 | <select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()"> | |
28 | <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option> | |
29 | </select> | |
30 | ||
31 | <select *ngIf="type === 'subtitles'" [(ngModel)]="subtitleLanguageId"> | |
32 | <option *ngFor="let caption of videoCaptions" [value]="caption.language.id">{{ caption.language.label }}</option> | |
33 | </select> | |
34 | </div> | |
35 | ||
36 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> | |
37 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> | |
38 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> | |
39 | <span class="glyphicon glyphicon-copy"></span> | |
40 | </button> | |
41 | </div> | |
42 | </div> | |
43 | </div> | |
44 | ||
45 | <ng-container *ngIf="type === 'video' && videoFile?.metadata"> | |
46 | <div ngbNav #nav="ngbNav" class="nav-tabs"> | |
47 | ||
48 | <ng-container ngbNavItem> | |
49 | <a ngbNavLink i18n>Format</a> | |
50 | <ng-template ngbNavContent> | |
51 | <div class="file-metadata"> | |
52 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataFormat | keyvalue"> | |
53 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | |
54 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | |
55 | </div> | |
56 | </div> | |
57 | </ng-template> | |
58 | </ng-container> | |
59 | ||
60 | <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined"> | |
61 | <a ngbNavLink i18n>Video stream</a> | |
62 | <ng-template ngbNavContent> | |
63 | <div class="file-metadata"> | |
64 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | keyvalue"> | |
65 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | |
66 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | |
67 | </div> | |
68 | </div> | |
69 | </ng-template> | |
70 | </ng-container> | |
71 | ||
72 | <ng-container ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined"> | |
73 | <a ngbNavLink i18n>Audio stream</a> | |
74 | <ng-template ngbNavContent> | |
75 | <div class="file-metadata"> | |
76 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue"> | |
77 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | |
78 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | |
79 | </div> | |
80 | </div> | |
81 | </ng-template> | |
82 | </ng-container> | |
83 | </div> | |
84 | ||
85 | <div [ngbNavOutlet]="nav"></div> | |
86 | </ng-container> | |
87 | ||
88 | <div class="download-type" *ngIf="type === 'video'"> | |
89 | <div class="peertube-radio-container"> | |
90 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> | |
91 | <label i18n for="download-direct">Direct download</label> | |
92 | </div> | |
93 | ||
94 | <div class="peertube-radio-container"> | |
95 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> | |
96 | <label i18n for="download-torrent">Torrent (.torrent file)</label> | |
97 | </div> | |
98 | </div> | |
99 | </div> | |
100 | ||
101 | <div class="modal-footer inputs"> | |
102 | <input | |
103 | type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel" | |
104 | (click)="hide()" (key.enter)="hide()" | |
105 | > | |
106 | ||
107 | <input | |
108 | type="submit" i18n-value value="Download" class="action-button-submit" | |
109 | (click)="download()" | |
110 | > | |
111 | </div> | |
112 | </ng-template> |