]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
emit more specific status codes on video upload (#3423)
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-add-components / video-upload.component.html
1 <div *ngIf="!isUploadingVideo" class="upload-video-container" dragDrop (fileDropped)="setVideoFile($event)">
2 <div class="first-step-block">
3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
4
5 <div class="button-file form-control" [ngbTooltip]="'(extensions: ' + videoExtensions + ')'">
6 <span i18n>Select the file to upload</span>
7 <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus />
8 </div>
9
10 <div class="form-group form-group-channel">
11 <label i18n for="first-step-channel">Channel</label>
12 <my-select-channel
13 labelForId="first-step-channel" [items]="userVideoChannels" [(ngModel)]="firstStepChannelId"
14 ></my-select-channel>
15 </div>
16
17 <div class="form-group">
18 <label i18n for="first-step-privacy">Privacy</label>
19 <my-select-options
20 labelForId="first-step-privacy" [items]="videoPrivacies" [(ngModel)]="firstStepPrivacyId"
21 ></my-select-options>
22 </div>
23
24 <ng-container *ngIf="isUploadingAudioFile">
25 <div class="form-group audio-preview">
26 <label i18n for="previewfileUpload">Video background image</label>
27
28 <div i18n class="audio-image-info">
29 Image that will be merged with your audio file.
30 <br />
31 The chosen image will be definitive and cannot be modified.
32 </div>
33
34 <my-preview-upload
35 i18n-inputLabel inputLabel="Edit" inputName="previewfileUpload" [(ngModel)]="previewfileUpload"
36 previewWidth="360px" previewHeight="200px"
37 ></my-preview-upload>
38 </div>
39
40 <div class="form-group upload-audio-button">
41 <my-button className="orange-button" i18n-label [label]="getAudioUploadLabel()" icon="upload" (click)="uploadFirstStep(true)"></my-button>
42 </div>
43 </ng-container>
44 </div>
45 </div>
46
47 <!-- Upload progress/cancel/error/success header -->
48 <div *ngIf="isUploadingVideo && !error" class="upload-progress-cancel">
49 <div class="progress" i18n-title title="Total video uploaded">
50 <div class="progress-bar" role="progressbar" [style]="{ width: videoUploadPercents + '%' }" [attr.aria-valuenow]="videoUploadPercents" aria-valuemin="0" [attr.aria-valuemax]="100">
51 <span *ngIf="videoUploadPercents === 100 && videoUploaded === false" i18n>Processing…</span>
52 <span *ngIf="videoUploadPercents !== 100 || videoUploaded">{{ videoUploadPercents }}%</span>
53 </div>
54 </div>
55 <input *ngIf="videoUploaded === false" type="button" i18n-value="Cancel ongoing upload of a video" value="Cancel" (click)="cancelUpload()" />
56 </div>
57
58 <div *ngIf="error && enableRetryAfterError" class="upload-progress-retry">
59 <div class="progress">
60 <div class="progress-bar red" role="progressbar" [style]="{ width: '100%' }" [attr.aria-valuenow]="100" aria-valuemin="0" [attr.aria-valuemax]="100">
61 <span>{{ error }}</span>
62 </div>
63 </div>
64 <div class="btn-group" role="group">
65 <input type="button" class="btn" i18n-value="Retry failed upload of a video" value="Retry" (click)="retryUpload()" />
66 <input type="button" class="btn" i18n-value="Cancel ongoing upload of a video" value="Cancel" (click)="cancelUpload()" />
67 </div>
68 </div>
69
70 <div *ngIf="error && !enableRetryAfterError" class="alert alert-danger">
71 <div i18n>Sorry, but something went wrong</div>
72 {{ error }}
73 </div>
74
75 <div *ngIf="videoUploaded && !error" class="alert alert-info" i18n>
76 Congratulations! Your video is now available in your private library.
77 </div>
78
79 <!-- Hidden because we want to load the component -->
80 <form [hidden]="!isUploadingVideo" novalidate [formGroup]="form" class="mb-3">
81 <my-video-edit
82 [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
83 [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
84 [waitTranscodingEnabled]="waitTranscodingEnabled"
85 type="upload"
86 ></my-video-edit>
87
88 <div class="submit-container">
89 <div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
90
91 <my-button className="submit-button orange-button" i18n-label label="Publish" icon="circle-tick"
92 (click)="updateSecondStep()" (keydown.enter)="updateSecondStep()"
93 [disabled]="isPublishingButtonDisabled()"
94 ></my-button>
95 </div>
96 </form>