diff options
Diffstat (limited to 'client/src/app/shared/shared-video-miniature/video-download.component.html')
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-download.component.html | 152 |
1 files changed, 90 insertions, 62 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.html b/client/src/app/shared/shared-video-miniature/video-download.component.html index 4608e93e7..4ac74c106 100644 --- a/client/src/app/shared/shared-video-miniature/video-download.component.html +++ b/client/src/app/shared/shared-video-miniature/video-download.component.html | |||
@@ -4,10 +4,10 @@ | |||
4 | <ng-container i18n>Download</ng-container> | 4 | <ng-container i18n>Download</ng-container> |
5 | 5 | ||
6 | <div *ngIf="videoCaptions" ngbDropdown class="d-inline-block ml-1"> | 6 | <div *ngIf="videoCaptions" ngbDropdown class="d-inline-block ml-1"> |
7 | <span id="dropdownDownloadType" ngbDropdownToggle> | 7 | <span id="dropdown-download-type" ngbDropdownToggle> |
8 | {{ type }} | 8 | {{ type }} |
9 | </span> | 9 | </span> |
10 | <div ngbDropdownMenu aria-labelledby="dropdownDownloadType"> | 10 | <div ngbDropdownMenu aria-labelledby="dropdown-download-type"> |
11 | <button *ngIf="type === 'video'" (click)="switchToType('subtitles')" ngbDropdownItem i18n>subtitles</button> | 11 | <button *ngIf="type === 'video'" (click)="switchToType('subtitles')" ngbDropdownItem i18n>subtitles</button> |
12 | <button *ngIf="type === 'subtitles'" (click)="switchToType('video')" ngbDropdownItem i18n>video</button> | 12 | <button *ngIf="type === 'subtitles'" (click)="switchToType('video')" ngbDropdownItem i18n>video</button> |
13 | </div> | 13 | </div> |
@@ -17,96 +17,124 @@ | |||
17 | </div> | 17 | </div> |
18 | 18 | ||
19 | <div class="modal-body"> | 19 | <div class="modal-body"> |
20 | <div class="form-group"> | 20 | <div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n> |
21 | <div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n> | 21 | The following link contains a private token and should not be shared with anyone. |
22 | The following link contains a private token and should not be shared with anyone. | 22 | </div> |
23 | </div> | ||
24 | 23 | ||
24 | <ng-container *ngIf="type === 'subtitles'"> | ||
25 | <div class="input-group input-group-sm"> | 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()" /> | 26 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> |
37 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> | 27 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> |
38 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> | 28 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> |
39 | <span class="glyphicon glyphicon-copy"></span> | 29 | <span class="glyphicon glyphicon-duplicate"></span> |
40 | </button> | 30 | </button> |
41 | </div> | 31 | </div> |
42 | </div> | 32 | </div> |
43 | </div> | 33 | </ng-container> |
44 | 34 | ||
45 | <ng-container *ngIf="type === 'video' && videoFile?.metadata"> | 35 | <ng-container *ngIf="type === 'video'"> |
46 | <div ngbNav #nav="ngbNav" class="nav-tabs"> | 36 | <div ngbNav #resolutionNav="ngbNav" class="nav-tabs" [activeId]="resolutionId" (activeIdChange)="onResolutionIdChange($event)"> |
47 | 37 | ||
48 | <ng-container ngbNavItem> | 38 | <ng-container *ngFor="let file of getVideoFiles()" [ngbNavItem]="file.resolution.id"> |
49 | <a ngbNavLink i18n>Format</a> | 39 | <a ngbNavLink i18n>{{ file.resolution.label }}</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 | 40 | ||
60 | <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined"> | ||
61 | <a ngbNavLink i18n>Video stream</a> | ||
62 | <ng-template ngbNavContent> | 41 | <ng-template ngbNavContent> |
63 | <div class="file-metadata"> | 42 | <div class="nav-content"> |
64 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | keyvalue"> | 43 | <div class="input-group input-group-sm"> |
65 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | 44 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> |
66 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | 45 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> |
46 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> | ||
47 | <span class="glyphicon glyphicon-duplicate"></span> | ||
48 | </button> | ||
49 | </div> | ||
67 | </div> | 50 | </div> |
68 | </div> | 51 | </div> |
69 | </ng-template> | 52 | </ng-template> |
70 | </ng-container> | 53 | </ng-container> |
54 | </div> | ||
55 | <div [ngbNavOutlet]="resolutionNav"></div> | ||
71 | 56 | ||
72 | <ng-container ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined"> | 57 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> |
73 | <a ngbNavLink i18n>Audio stream</a> | 58 | <ng-container *ngIf="videoFile?.metadata"> |
74 | <ng-template ngbNavContent> | 59 | <div ngbNav #nav="ngbNav" class="nav-tabs nav-metadata"> |
75 | <div class="file-metadata"> | 60 | <ng-container ngbNavItem> |
76 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue"> | 61 | <a ngbNavLink i18n>Format</a> |
77 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | 62 | <ng-template ngbNavContent> |
78 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | 63 | <div class="file-metadata"> |
79 | </div> | 64 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataFormat | 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 | |||
71 | <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined"> | ||
72 | <a ngbNavLink i18n>Video stream</a> | ||
73 | <ng-template ngbNavContent> | ||
74 | <div class="file-metadata"> | ||
75 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | keyvalue"> | ||
76 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | ||
77 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | ||
78 | </div> | ||
79 | </div> | ||
80 | </ng-template> | ||
81 | </ng-container> | ||
82 | |||
83 | <ng-container ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined"> | ||
84 | <a ngbNavLink i18n>Audio stream</a> | ||
85 | <ng-template ngbNavContent> | ||
86 | <div class="file-metadata"> | ||
87 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue"> | ||
88 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | ||
89 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | ||
90 | </div> | ||
91 | </div> | ||
92 | </ng-template> | ||
93 | </ng-container> | ||
94 | |||
95 | </ng-container> | ||
96 | </div> | ||
97 | <div [ngbNavOutlet]="nav"></div> | ||
98 | <div class="download-type"> | ||
99 | <div class="peertube-radio-container"> | ||
100 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> | ||
101 | <label i18n for="download-direct">Direct download</label> | ||
80 | </div> | 102 | </div> |
81 | </ng-template> | 103 | <div class="peertube-radio-container"> |
104 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> | ||
105 | <label i18n for="download-torrent">Torrent (.torrent file)</label> | ||
106 | </div> | ||
107 | </div> | ||
82 | </ng-container> | 108 | </ng-container> |
83 | </div> | 109 | </div> |
84 | 110 | ||
85 | <div [ngbNavOutlet]="nav"></div> | 111 | <div (click)="isAdvancedCustomizationCollapsed = !isAdvancedCustomizationCollapsed" role="button" class="advanced-filters-button" |
86 | </ng-container> | 112 | [attr.aria-expanded]="!isAdvancedCustomizationCollapsed" aria-controls="collapseBasic"> |
113 | <ng-container *ngIf="isAdvancedCustomizationCollapsed"> | ||
114 | <span class="glyphicon glyphicon-menu-down"></span> | ||
87 | 115 | ||
88 | <div class="download-type" *ngIf="type === 'video'"> | 116 | <ng-container i18n> |
89 | <div class="peertube-radio-container"> | 117 | Advanced |
90 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> | 118 | </ng-container> |
91 | <label i18n for="download-direct">Direct download</label> | 119 | </ng-container> |
92 | </div> | 120 | |
121 | <ng-container *ngIf="!isAdvancedCustomizationCollapsed"> | ||
122 | <span class="glyphicon glyphicon-menu-up"></span> | ||
93 | 123 | ||
94 | <div class="peertube-radio-container"> | 124 | <ng-container i18n> |
95 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> | 125 | Simple |
96 | <label i18n for="download-torrent">Torrent (.torrent file)</label> | 126 | </ng-container> |
127 | </ng-container> | ||
97 | </div> | 128 | </div> |
98 | </div> | 129 | </ng-container> |
99 | </div> | 130 | </div> |
100 | 131 | ||
101 | <div class="modal-footer inputs"> | 132 | <div class="modal-footer inputs"> |
102 | <input | 133 | <input |
103 | type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel" | 134 | type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button" |
104 | (click)="hide()" (key.enter)="hide()" | 135 | (click)="hide()" (key.enter)="hide()" |
105 | > | 136 | > |
106 | 137 | ||
107 | <input | 138 | <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" /> |
108 | type="submit" i18n-value value="Download" class="action-button-submit" | ||
109 | (click)="download()" | ||
110 | > | ||
111 | </div> | 139 | </div> |
112 | </ng-template> | 140 | </ng-template> |