aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html
blob: 3247a2bd6c381a03a44847c8c0f7724de5659829 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<div *ngIf="!isUploadingVideo" class="upload-video-container">
  <div class="first-step-block">
    <my-global-icon class="upload-icon" iconName="upload"></my-global-icon>

    <div class="button-file">
      <span i18n>Select the file to upload</span>
      <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" />
    </div>
    <span class="button-file-extension">({{ videoExtensions }})</span>

    <div class="form-group form-group-channel">
      <label i18n for="first-step-channel">Channel</label>
      <div class="peertube-select-container">
        <select id="first-step-channel" [(ngModel)]="firstStepChannelId">
          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
        </select>
      </div>
    </div>

    <div class="form-group">
      <label i18n for="first-step-privacy">Privacy</label>
      <div class="peertube-select-container">
        <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId">
          <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
          <option i18n [value]="SPECIAL_SCHEDULED_PRIVACY">Scheduled</option>
        </select>
      </div>
    </div>

    <ng-container *ngIf="isUploadingAudioFile">
      <div  class="form-group audio-preview">
        <label i18n for="previewfileUpload">Video background image</label>

        <div i18n class="audio-image-info">
          Image that will be merged with your audio file.
          <br />
          The chosen image will be definitive and cannot be modified.
        </div>

        <my-preview-upload
          i18n-inputLabel inputLabel="Edit" inputName="previewfileUpload" [(ngModel)]="previewfileUpload"
          previewWidth="360px" previewHeight="200px"
        ></my-preview-upload>
      </div>

      <div class="form-group upload-audio-button">
        <my-button className="orange-button" i18n-label [label]="getAudioUploadLabel()" icon="upload" (click)="uploadFirstStep(true)"></my-button>
      </div>
    </ng-container>
  </div>
</div>

<div *ngIf="isUploadingVideo && !error" class="upload-progress-cancel">
  <p-progressBar
    [value]="videoUploadPercents"
    [ngClass]="{ processing: videoUploadPercents === 100 && videoUploaded === false }"
  ></p-progressBar>
  <input *ngIf="videoUploaded === false" type="button" value="Cancel" (click)="cancelUpload()" />
</div>

<div *ngIf="error" class="alert alert-danger">
  <div i18n>Sorry, but something went wrong</div>
  {{ error }}
</div>

<div *ngIf="videoUploaded && !error" class="alert alert-info" i18n>
  Congratulations! Your video is now available in your private library.
</div>

<!-- Hidden because we want to load the component -->
<form [hidden]="!isUploadingVideo" novalidate [formGroup]="form">
  <my-video-edit
    [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
    [validationMessages]="validationMessages" [videoPrivacies]="explainedVideoPrivacies" [userVideoChannels]="userVideoChannels"
    [waitTranscodingEnabled]="waitTranscodingEnabled"
  ></my-video-edit>

  <div class="submit-container">
    <div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>

    <div class="submit-button"
       (click)="updateSecondStep()"
       [ngClass]="{ disabled: isPublishingButtonDisabled() }"
    >
      <my-global-icon iconName="validate"></my-global-icon>
      <input [disabled]="isPublishingButtonDisabled()" type="button" i18n-value value="Publish" />
    </div>
  </div>
</form>