]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/video-watch.component.html
Fix live tests
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.html
index 0447268f0d3a0458a573be085f5855a706690cf5..602214ac58cc66936a8c4650d20ac0a6072e24a2 100644 (file)
@@ -11,7 +11,8 @@
 
     <my-video-watch-playlist
       #videoWatchPlaylist
-      [video]="video" [playlist]="playlist" class="playlist"
+      [playlist]="playlist" class="playlist"
+      (videoFound)="onPlaylistVideoFound($event)"
     ></my-video-watch-playlist>
   </div>
 
       This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
     </div>
 
+    <div i18n class="col-md-12 alert alert-info" *ngIf="isWaitingForLive()">
+      This live has not started yet.
+    </div>
+
+    <div i18n class="col-md-12 alert alert-info" *ngIf="isLiveEnded()">
+      This live has ended.
+    </div>
+
     <div class="col-md-12 alert alert-danger" *ngIf="video?.blacklisted">
       <div class="blocked-label" i18n>This video is blocked.</div>
       {{ video.blockedReason }}
           <div class="d-block d-md-none"> <!-- only shown on medium devices, has its counterpart for larger viewports below -->
             <h1 class="video-info-name">{{ video.name }}</h1>
 
-            <div i18n class="video-info-date-views">
-              Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle> <span class="views"> • {{ video.views | myNumberFormatter }} views</span>
+            <div class="video-info-date-views">
+              <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
+
+              <span i18n [title]="video.getExactNumberOfViews()" class="views">
+                • {{ video.views | myNumberFormatter }}
+                <ng-container *ngIf="!video.isLive">views</ng-container>
+                <ng-container *ngIf="video.isLive">viewers</ng-container>
+              </span>
             </div>
           </div>
 
             </div>
 
             <div class="video-info-first-row-bottom">
-              <div i18n class="d-none d-md-block video-info-date-views">
-                Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle> <span class="views"> • {{ video.views | myNumberFormatter }} views</span>
+              <div class="d-none d-md-block video-info-date-views">
+                <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
+
+                <span i18n [title]="video.getExactNumberOfViews()" class="views">
+                  • {{ video.views | myNumberFormatter }}
+                  <ng-container *ngIf="!video.isLive">views</ng-container>
+                  <ng-container *ngIf="video.isLive">viewers</ng-container>
+                </span>
               </div>
 
               <div class="video-actions-rates">
+                <ng-template #ratePopoverText>
+                  <span [innerHTML]="getRatePopoverText()"></span>
+                </ng-template>
+
                 <div class="video-actions fullWidth justify-content-end">
                   <button
-                    [ngbPopover]="getRatePopoverText()" [ngClass]="{ 'activated': userRating === 'like' }" (click)="setLike()" (keyup.enter)="setLike()"
+                    [ngbPopover]="getRatePopoverText() && ratePopoverText" [ngClass]="{ 'activated': userRating === 'like' }" (click)="setLike()" (keyup.enter)="setLike()"
                     class="action-button action-button-like" [attr.aria-pressed]="userRating === 'like'" [attr.aria-label]="tooltipLike"
                     [ngbTooltip]="tooltipLike"
                     placement="bottom auto"
@@ -70,7 +95,7 @@
                 </button>
 
                   <button
-                    [ngbPopover]="getRatePopoverText()" [ngClass]="{ 'activated': userRating === 'dislike' }" (click)="setDislike()" (keyup.enter)="setDislike()"
+                    [ngbPopover]="getRatePopoverText() && ratePopoverText" [ngClass]="{ 'activated': userRating === 'dislike' }" (click)="setDislike()" (keyup.enter)="setDislike()"
                     class="action-button action-button-dislike" [attr.aria-pressed]="userRating === 'dislike'" [attr.aria-label]="tooltipDislike"
                     [ngbTooltip]="tooltipDislike"
                     placement="bottom auto"
                     </div>
                   </div>
 
-                  <my-video-actions-dropdown
-                    placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
-                    (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
-                  ></my-video-actions-dropdown>
+                  <ng-container *ngIf="!isUserLoggedIn() && !isLive()">
+                    <button
+                      *ngIf="isVideoDownloadable()" class="action-button action-button-save"
+                      (click)="showDownloadModal()" (keydown.enter)="showDownloadModal()"
+                    >
+                      <my-global-icon iconName="download" aria-hidden="true"></my-global-icon>
+                      <span class="icon-text d-none d-sm-inline" i18n>DOWNLOAD</span>
+                    </button>
+
+                    <my-video-download #videoDownloadModal></my-video-download>
+                  </ng-container>
+
+                  <ng-container *ngIf="isUserLoggedIn()">
+                    <my-video-actions-dropdown
+                      placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
+                      [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
+                    ></my-video-actions-dropdown>
+                  </ng-container>
                 </div>
 
                 <div class="video-info-likes-dislikes-bar-outer-container">
 
           <div class="pt-3 border-top video-info-channel d-flex">
             <div class="video-info-channel-left d-flex">
-              <avatar-channel [video]="video"></avatar-channel>
+              <my-video-avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></my-video-avatar-channel>
 
               <div class="video-info-channel-left-links ml-1">
-                <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Channel page">
-                  {{ video.channel.displayName }}
-                </a>
-                <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Account page">
-                  <span i18n>By {{ video.byAccount }}</span>
-                </a>
+                <ng-container *ngIf="!isChannelDisplayNameGeneric()">
+                  <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Channel page">
+                    {{ video.channel.displayName }}
+                  </a>
+                  <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Account page">
+                    <span i18n>By {{ video.byAccount }}</span>
+                  </a>
+                </ng-container>
+
+                <ng-container *ngIf="isChannelDisplayNameGeneric()">
+                  <a [routerLink]="[ '/accounts', video.byAccount ]" class="single-link" i18n-title title="Account page">
+                    <span i18n>{{ video.byAccount }}</span>
+                  </a>
+                </ng-container>
               </div>
             </div>
 
           >{{ tag }}</a>
         </div>
 
-        <div class="video-attribute">
+        <div class="video-attribute" *ngIf="!video.isLive">
           <span i18n class="video-attribute-label">Duration</span>
-          <span class="video-attribute-value">{{ video.duration | myVideoDurationFormatter }}</span>
+          <span class="video-attribute-value">{{ video.duration | myDurationFormatter }}</span>
         </div>
       </div>