]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+videos/+video-watch/video-watch.component.html
Refactor views component
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.html
CommitLineData
9a18a625 1<div class="root" [ngClass]="{ 'theater-enabled': theaterEnabled }">
897ec54d 2 <!-- We need the video container for videojs so we just hide it -->
e2f01c47 3 <div id="video-wrapper">
6d88de72
C
4 <div *ngIf="remoteServerDown" class="remote-server-down">
5 Sorry, but this video is not available because the remote instance is not responding.
6 <br />
7 Please try again later.
8 </div>
e2f01c47
C
9
10 <div id="videojs-wrapper"></div>
11
72675ebe
C
12 <my-video-watch-playlist
13 #videoWatchPlaylist
d142c7b9
C
14 [playlist]="playlist" class="playlist"
15 (videoFound)="onPlaylistVideoFound($event)"
72675ebe 16 ></my-video-watch-playlist>
d1992b93 17 </div>
897ec54d 18
2b3f1919
C
19 <div class="row">
20 <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToImport()">
21 The video is being imported, it will be available when the import is finished.
22 </div>
516df59b 23
2b3f1919
C
24 <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToTranscode()">
25 The video is being transcoded, it may not work properly.
26 </div>
2186386c 27
2b3f1919
C
28 <div i18n class="col-md-12 alert alert-info" *ngIf="hasVideoScheduledPublication()">
29 This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
30 </div>
191764f3 31
a5cf76af
C
32 <div i18n class="col-md-12 alert alert-info" *ngIf="isWaitingForLive()">
33 This live has not started yet.
34 </div>
35
36 <div i18n class="col-md-12 alert alert-info" *ngIf="isLiveEnded()">
5c0904fc 37 This live has ended.
a5cf76af
C
38 </div>
39
2b3f1919 40 <div class="col-md-12 alert alert-danger" *ngIf="video?.blacklisted">
5baee5fc
RK
41 <div class="blocked-label" i18n>This video is blocked.</div>
42 {{ video.blockedReason }}
2b3f1919 43 </div>
bbe0f064
C
44 </div>
45
20206dfb 46 <!-- Video information -->
2303a803 47 <div *ngIf="video" class="margin-content video-bottom">
9a18a625
C
48 <div class="video-info">
49 <div class="video-info-first-row">
50 <div>
7fc441cc 51 <div class="d-block d-md-none"> <!-- only shown on medium devices, has its counterpart for larger viewports below -->
9a18a625 52 <h1 class="video-info-name">{{ video.name }}</h1>
7fc441cc 53
5c0904fc
C
54 <div class="video-info-date-views">
55 <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
5cac83a7
C
56
57 <my-video-views-counter [video]="video"></my-video-views-counter>
9a18a625
C
58 </div>
59 </div>
60
7fc441cc 61 <div class="d-flex justify-content-between flex-direction-column">
9a18a625 62 <div class="d-none d-md-block">
f845c683 63 <h1 class="video-info-name">{{ video.name }}</h1>
7fc441cc 64 </div>
9a18a625 65
7fc441cc 66 <div class="video-info-first-row-bottom">
5c0904fc
C
67 <div class="d-none d-md-block video-info-date-views">
68 <ng-container i18n>Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle></ng-container>
69
4ec25ae8 70 <span i18n [title]="video.getExactNumberOfViews()" class="views">
5c0904fc
C
71 • {{ video.views | myNumberFormatter }}
72 <ng-container *ngIf="!video.isLive">views</ng-container>
73 <ng-container *ngIf="video.isLive">viewers</ng-container>
74 </span>
2d9fea16 75 </div>
2d9fea16 76
7fc441cc 77 <div class="video-actions-rates">
214ff6fa 78 <ng-template #ratePopoverText>
79 <span [innerHTML]="getRatePopoverText()"></span>
80 </ng-template>
81
7fc441cc 82 <div class="video-actions fullWidth justify-content-end">
adcf9212 83 <button
214ff6fa 84 [ngbPopover]="getRatePopoverText() && ratePopoverText" [ngClass]="{ 'activated': userRating === 'like' }" (click)="setLike()" (keyup.enter)="setLike()"
adcf9212 85 class="action-button action-button-like" [attr.aria-pressed]="userRating === 'like'" [attr.aria-label]="tooltipLike"
94dfca3e
RK
86 [ngbTooltip]="tooltipLike"
87 placement="bottom auto"
7fc441cc
RK
88 >
89 <my-global-icon iconName="like"></my-global-icon>
90 <span *ngIf="video.likes" class="count">{{ video.likes }}</span>
adcf9212 91 </button>
2d3741d6 92
adcf9212 93 <button
214ff6fa 94 [ngbPopover]="getRatePopoverText() && ratePopoverText" [ngClass]="{ 'activated': userRating === 'dislike' }" (click)="setDislike()" (keyup.enter)="setDislike()"
adcf9212 95 class="action-button action-button-dislike" [attr.aria-pressed]="userRating === 'dislike'" [attr.aria-label]="tooltipDislike"
94dfca3e
RK
96 [ngbTooltip]="tooltipDislike"
97 placement="bottom auto"
7fc441cc
RK
98 >
99 <my-global-icon iconName="dislike"></my-global-icon>
100 <span *ngIf="video.dislikes" class="count">{{ video.dislikes }}</span>
adcf9212 101 </button>
3adf3196 102
adcf9212 103 <button *ngIf="video.support" (click)="showSupportModal()" (keyup.enter)="showSupportModal()" class="action-button action-button-support" [attr.aria-label]="tooltipSupport"
94dfca3e
RK
104 [ngbTooltip]="tooltipSupport"
105 placement="bottom auto"
106 >
adcf9212 107 <my-global-icon iconName="support" aria-hidden="true"></my-global-icon>
14571f19 108 <span class="icon-text" i18n>SUPPORT</span>
adcf9212 109 </button>
3adf3196 110
adcf9212 111 <button (click)="showShareModal()" (keyup.enter)="showShareModal()" class="action-button">
6ad971d5 112 <my-global-icon iconName="share" aria-hidden="true"></my-global-icon>
14571f19 113 <span class="icon-text" i18n>SHARE</span>
adcf9212 114 </button>
3adf3196 115
7fc441cc
RK
116 <div
117 class="action-dropdown" ngbDropdown placement="top" role="button" autoClose="outside"
118 *ngIf="isUserLoggedIn()" (openChange)="addContent.openChange($event)"
94dfca3e
RK
119 [ngbTooltip]="tooltipSaveToPlaylist"
120 placement="bottom auto"
7fc441cc 121 >
adcf9212 122 <button class="action-button action-button-save" ngbDropdownToggle>
6ad971d5 123 <my-global-icon iconName="playlist-add" aria-hidden="true"></my-global-icon>
14571f19 124 <span class="icon-text" i18n>SAVE</span>
adcf9212 125 </button>
3adf3196 126
7fc441cc
RK
127 <div ngbDropdownMenu>
128 <my-video-add-to-playlist #addContent [video]="video"></my-video-add-to-playlist>
129 </div>
130 </div>
3adf3196 131
a5cf76af 132 <ng-container *ngIf="!isUserLoggedIn() && !isLive()">
6863f814
RK
133 <button
134 *ngIf="isVideoDownloadable()" class="action-button action-button-save"
135 (click)="showDownloadModal()" (keydown.enter)="showDownloadModal()"
136 >
137 <my-global-icon iconName="download" aria-hidden="true"></my-global-icon>
138 <span class="icon-text d-none d-sm-inline" i18n>DOWNLOAD</span>
139 </button>
82f443de 140
6863f814
RK
141 <my-video-download #videoDownloadModal></my-video-download>
142 </ng-container>
82f443de 143
6863f814
RK
144 <ng-container *ngIf="isUserLoggedIn()">
145 <my-video-actions-dropdown
146 placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
f8c00564 147 [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
6863f814
RK
148 ></my-video-actions-dropdown>
149 </ng-container>
9a18a625 150 </div>
3adf3196 151
223b24e6 152 <div class="video-info-likes-dislikes-bar-outer-container">
2de7f588 153 <div
223b24e6 154 class="video-info-likes-dislikes-bar-inner-container"
2de7f588
RK
155 *ngIf="video.likes !== 0 || video.dislikes !== 0"
156 [ngbTooltip]="likesBarTooltipText"
157 placement="bottom"
158 >
159 <div
160 class="video-info-likes-dislikes-bar"
161 >
0240da5c 162 <div class="likes-bar" [ngClass]="{ 'liked': userRating !== 'none' }" [ngStyle]="{ 'width.%': video.likesPercent }"></div>
2de7f588
RK
163 </div>
164 </div>
9a18a625 165 </div>
9a18a625 166 </div>
2d3741d6 167
9a18a625
C
168 <div
169 class="video-info-likes-dislikes-bar"
170 *ngIf="video.likes !== 0 || video.dislikes !== 0"
171 [ngbTooltip]="likesBarTooltipText"
172 placement="bottom"
173 >
174 <div class="likes-bar" [ngStyle]="{ 'width.%': video.likesPercent }"></div>
2d9fea16 175 </div>
1f788f20 176 </div>
9a18a625 177 </div>
6a9e1d42 178
07fa4c97 179
dd4f25ee
RK
180 <div class="pt-3 border-top video-info-channel d-flex">
181 <div class="video-info-channel-left d-flex">
69524f6e 182 <my-video-avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></my-video-avatar-channel>
62fca05d 183
dd4f25ee 184 <div class="video-info-channel-left-links ml-1">
b40a2193
K
185 <ng-container *ngIf="!isChannelDisplayNameGeneric()">
186 <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Channel page">
187 {{ video.channel.displayName }}
188 </a>
189 <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Account page">
190 <span i18n>By {{ video.byAccount }}</span>
191 </a>
192 </ng-container>
193
194 <ng-container *ngIf="isChannelDisplayNameGeneric()">
195 <a [routerLink]="[ '/accounts', video.byAccount ]" class="single-link" i18n-title title="Account page">
196 <span i18n>{{ video.byAccount }}</span>
197 </a>
198 </ng-container>
dd4f25ee
RK
199 </div>
200 </div>
63347a0f 201
41eb700f 202 <my-subscribe-button #subscribeButton [videoChannels]="[video.channel]" size="small"></my-subscribe-button>
2d9fea16 203 </div>
2d9fea16 204 </div>
26b7305a 205
9a18a625 206 </div>
191764f3 207
dd4f25ee 208 <div class="video-info-description">
b29bf61d
RK
209 <div
210 class="video-info-description-html"
208c7e92 211 [innerHTML]="videoHTMLDescription"
b29bf61d
RK
212 (timestampClicked)="handleTimestampClicked($event)"
213 timestampRouteTransformer
214 ></div>
d07137b9 215
9a18a625
C
216 <div class="video-info-description-more" *ngIf="completeDescriptionShown === false && video.description?.length >= 250" (click)="showMoreDescription()">
217 <ng-container i18n>Show more</ng-container>
218 <span *ngIf="descriptionLoading === false" class="glyphicon glyphicon-menu-down"></span>
219 <my-small-loader class="description-loading" [loading]="descriptionLoading"></my-small-loader>
1f788f20 220 </div>
09223546 221
9a18a625
C
222 <div *ngIf="completeDescriptionShown === true" (click)="showLessDescription()" class="video-info-description-more">
223 <ng-container i18n>Show less</ng-container>
224 <span *ngIf="descriptionLoading === false" class="glyphicon glyphicon-menu-up"></span>
225 </div>
226 </div>
adb115f5 227
dd4f25ee 228 <div class="video-attributes mb-3">
9a18a625
C
229 <div class="video-attribute">
230 <span i18n class="video-attribute-label">Privacy</span>
231 <span class="video-attribute-value">{{ video.privacy.label }}</span>
232 </div>
2de96f4d 233
c910f667
C
234 <div *ngIf="video.isLocal === false" class="video-attribute">
235 <span i18n class="video-attribute-label">Origin instance</span>
236 <a class="video-attribute-value" target="_blank" rel="noopener noreferrer" [href]="video.originInstanceUrl">{{ video.originInstanceHost }}</a>
237 </div>
238
9a18a625
C
239 <div *ngIf="!!video.originallyPublishedAt" class="video-attribute">
240 <span i18n class="video-attribute-label">Originally published</span>
241 <span class="video-attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span>
242 </div>
2de96f4d 243
9a18a625
C
244 <div class="video-attribute">
245 <span i18n class="video-attribute-label">Category</span>
246 <span *ngIf="!video.category.id" class="video-attribute-value">{{ video.category.label }}</span>
247 <a
248 *ngIf="video.category.id" class="video-attribute-value"
249 [routerLink]="[ '/search' ]" [queryParams]="{ categoryOneOf: [ video.category.id ] }"
250 >{{ video.category.label }}</a>
251 </div>
db216afd 252
9a18a625
C
253 <div class="video-attribute">
254 <span i18n class="video-attribute-label">Licence</span>
255 <span *ngIf="!video.licence.id" class="video-attribute-value">{{ video.licence.label }}</span>
256 <a
257 *ngIf="video.licence.id" class="video-attribute-value"
258 [routerLink]="[ '/search' ]" [queryParams]="{ licenceOneOf: [ video.licence.id ] }"
259 >{{ video.licence.label }}</a>
260 </div>
fd45e8f4 261
9a18a625
C
262 <div class="video-attribute">
263 <span i18n class="video-attribute-label">Language</span>
264 <span *ngIf="!video.language.id" class="video-attribute-value">{{ video.language.label }}</span>
265 <a
266 *ngIf="video.language.id" class="video-attribute-value"
267 [routerLink]="[ '/search' ]" [queryParams]="{ languageOneOf: [ video.language.id ] }"
268 >{{ video.language.label }}</a>
20206dfb 269 </div>
09223546 270
9a18a625
C
271 <div class="video-attribute video-attribute-tags">
272 <span i18n class="video-attribute-label">Tags</span>
273 <a
274 *ngFor="let tag of getVideoTags()"
275 class="video-attribute-value" [routerLink]="[ '/search' ]" [queryParams]="{ tagsOneOf: [ tag ] }"
276 >{{ tag }}</a>
277 </div>
df8340b7 278
da0310f8 279 <div class="video-attribute" *ngIf="!video.isLive">
df8340b7 280 <span i18n class="video-attribute-label">Duration</span>
b5b68755 281 <span class="video-attribute-value">{{ video.duration | myDurationFormatter }}</span>
62fca05d 282 </div>
3b766e18
RK
283 </div>
284
b29bf61d
RK
285 <my-video-comments
286 class="border-top"
287 [video]="video"
288 [user]="user"
289 (timestampClicked)="handleTimestampClicked($event)"
290 ></my-video-comments>
d1992b93 291 </div>
9a18a625 292
6aa54148 293 <my-recommended-videos
5c20a455 294 [inputRecommendation]="{ uuid: video.uuid, tags: video.tags }"
5c20a455
C
295 [playlist]="playlist"
296 (gotRecommendations)="onRecommendations($event)"
6aa54148 297 ></my-recommended-videos>
d1992b93 298 </div>
8ff3f883 299
2b3f1919 300 <div class="row privacy-concerns" *ngIf="hasAlreadyAcceptedPrivacyConcern === false">
2b3b76ab 301 <div class="privacy-concerns-text">
52e3beb9
RK
302 <span class="mr-2">
303 <strong i18n>Friendly Reminder: </strong>
304 <ng-container i18n>
305 the sharing system used for this video implies that some technical information about your system (such as a public IP address) can be sent to other peers.
306 </ng-container>
d3217560 307 </span>
5411da31 308 <a i18n i18n-title title="Get more information" target="_blank" rel="noopener noreferrer" href="/about/peertube#privacy">More information</a>
2b3b76ab
C
309 </div>
310
d3217560 311 <div i18n class="privacy-concerns-button privacy-concerns-okay" (click)="acceptedPrivacyConcern()">
52e3beb9 312 OK
2b3b76ab
C
313 </div>
314 </div>
b59f12b0 315</div>
d1992b93 316
5a71acd2 317<ng-container *ngIf="video !== null">
1f3a605e 318 <my-video-support #videoSupportModal [video]="video"></my-video-support>
3a1fed11 319 <my-video-share #videoShareModal [video]="video" [videoCaptions]="videoCaptions" [playlist]="playlist"></my-video-share>
5a71acd2 320</ng-container>