aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch')
-rw-r--r--client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html4
-rw-r--r--client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss33
-rw-r--r--client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.html1
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.scss51
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts5
6 files changed, 52 insertions, 44 deletions
diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html
index 3c7c679b8..e0e9f92e7 100644
--- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html
+++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html
@@ -1,4 +1,4 @@
1<div class="other-videos"> 1<div class="other-videos" [ngClass]="{ 'display-as-row': displayAsRow }">
2 <ng-container *ngIf="hasVideos$ | async"> 2 <ng-container *ngIf="hasVideos$ | async">
3 <div class="title-page-container"> 3 <div class="title-page-container">
4 <h2 i18n class="title-page title-page-single"> 4 <h2 i18n class="title-page title-page-single">
@@ -14,7 +14,7 @@
14 14
15 <ng-container *ngFor="let video of (videos$ | async); let i = index; let length = count"> 15 <ng-container *ngFor="let video of (videos$ | async); let i = index; let length = count">
16 <my-video-miniature 16 <my-video-miniature
17 [displayOptions]="displayOptions" [video]="video" [user]="userMiniature" 17 [displayOptions]="displayOptions" [video]="video" [user]="userMiniature" [displayAsRow]="displayAsRow"
18 (videoBlocked)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()" (videoAccountMuted)="onVideoRemoved()"> 18 (videoBlocked)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()" (videoAccountMuted)="onVideoRemoved()">
19 </my-video-miniature> 19 </my-video-miniature>
20 20
diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss
index b278c9654..c9fae6f27 100644
--- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss
+++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss
@@ -1,3 +1,6 @@
1@import '_variables';
2@import '_mixins';
3
1.title-page-container { 4.title-page-container {
2 display: flex; 5 display: flex;
3 justify-content: space-between; 6 justify-content: space-between;
@@ -11,6 +14,10 @@
11 } 14 }
12} 15}
13 16
17.title-page {
18 margin-top: 0;
19}
20
14.title-page-autoplay { 21.title-page-autoplay {
15 display: flex; 22 display: flex;
16 width: max-content; 23 width: max-content;
@@ -29,3 +36,29 @@
29hr { 36hr {
30 margin-top: 0; 37 margin-top: 0;
31} 38}
39
40my-video-miniature {
41 display: block;
42}
43
44.other-videos:not(.display-as-row) my-video-miniature {
45 min-width: $video-thumbnail-medium-width;
46 max-width: $video-thumbnail-medium-width;
47}
48
49.display-as-row {
50 my-video-miniature {
51 margin-bottom: 20px;
52 }
53
54 hr {
55 display: none;
56 }
57
58 @media screen and (max-width: $mobile-view) {
59 my-video-miniature {
60 margin-bottom: 10px;
61 }
62 }
63}
64
diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts
index a1c8e0661..89b9c01b6 100644
--- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts
+++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts
@@ -16,6 +16,8 @@ import { RecommendedVideosStore } from './recommended-videos.store'
16export class RecommendedVideosComponent implements OnInit, OnChanges { 16export class RecommendedVideosComponent implements OnInit, OnChanges {
17 @Input() inputRecommendation: RecommendationInfo 17 @Input() inputRecommendation: RecommendationInfo
18 @Input() playlist: VideoPlaylist 18 @Input() playlist: VideoPlaylist
19 @Input() displayAsRow: boolean
20
19 @Output() gotRecommendations = new EventEmitter<Video[]>() 21 @Output() gotRecommendations = new EventEmitter<Video[]>()
20 22
21 autoPlayNextVideo: boolean 23 autoPlayNextVideo: boolean
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html
index 07f7ab7e3..5d417609a 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.html
+++ b/client/src/app/+videos/+video-watch/video-watch.component.html
@@ -289,6 +289,7 @@
289 </div> 289 </div>
290 290
291 <my-recommended-videos 291 <my-recommended-videos
292 [displayAsRow]="displayOtherVideosAsRow()"
292 [inputRecommendation]="{ uuid: video.uuid, tags: video.tags }" 293 [inputRecommendation]="{ uuid: video.uuid, tags: video.tags }"
293 [playlist]="playlist" 294 [playlist]="playlist"
294 (gotRecommendations)="onRecommendations($event)" 295 (gotRecommendations)="onRecommendations($event)"
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.scss b/client/src/app/+videos/+video-watch/video-watch.component.scss
index a67605217..f22ffc0ea 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/+videos/+video-watch/video-watch.component.scss
@@ -407,37 +407,12 @@ $video-info-margin-left: 44px;
407 } 407 }
408 } 408 }
409 } 409 }
410}
410 411
411 ::ng-deep .other-videos { 412my-recommended-videos {
412 padding-left: 15px; 413 display: block;
413 min-width: $video-miniature-width; 414 padding-left: 15px;
414 415 min-width: 250px;
415 @media screen and (min-width: 1800px - (3* $video-miniature-width)) {
416 width: min-content;
417 }
418
419 .title-page {
420 margin: 0 !important;
421 }
422
423 .video-miniature {
424 display: flex;
425 width: max-content;
426 height: 100%;
427 padding-bottom: 20px;
428 flex-wrap: wrap;
429 }
430
431 .video-bottom {
432 @media screen and (max-width: 1800px - (3* $video-miniature-width)) {
433 margin-left: 1rem;
434 }
435 @media screen and (max-width: 500px) {
436 margin-left: 0;
437 margin-top: .5rem;
438 }
439 }
440 }
441} 416}
442 417
443my-video-comments { 418my-video-comments {
@@ -531,6 +506,7 @@ my-video-comments {
531 } 506 }
532} 507}
533 508
509// Use the same breakpoint than in the typescript component to display the other video miniatures as row
534@media screen and (max-width: 1100px) { 510@media screen and (max-width: 1100px) {
535 #video-wrapper { 511 #video-wrapper {
536 flex-direction: column; 512 flex-direction: column;
@@ -543,15 +519,10 @@ my-video-comments {
543 519
544 .video-bottom { 520 .video-bottom {
545 flex-direction: column; 521 flex-direction: column;
522 }
546 523
547 ::ng-deep .other-videos { 524 my-recommended-videos {
548 padding-left: 0 !important; 525 padding-left: 0;
549
550 ::ng-deep .video-miniature {
551 flex-direction: row;
552 width: auto;
553 }
554 }
555 } 526 }
556} 527}
557 528
@@ -573,10 +544,6 @@ my-video-comments {
573 } 544 }
574 } 545 }
575 546
576 ::ng-deep .other-videos .video-miniature {
577 flex-direction: column;
578 }
579
580 .privacy-concerns { 547 .privacy-concerns {
581 width: 100%; 548 width: 100%;
582 } 549 }
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 075f70f56..9656f08e9 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -398,6 +398,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
398 this.loadVideo(videoId) 398 this.loadVideo(videoId)
399 } 399 }
400 400
401 displayOtherVideosAsRow () {
402 // Use the same value as in the SASS file
403 return this.screenService.getWindowInnerWidth() <= 1100
404 }
405
401 private loadVideo (videoId: string) { 406 private loadVideo (videoId: string) {
402 // Video did not change 407 // Video did not change
403 if (this.video && this.video.uuid === videoId) return 408 if (this.video && this.video.uuid === videoId) return