diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html index fb7f86852..94a38019d 100644 --- a/client/src/app/shared/video/abstract-video-list.html +++ b/client/src/app/shared/video/abstract-video-list.html | |||
@@ -9,7 +9,7 @@ | |||
9 | myInfiniteScroller | 9 | myInfiniteScroller |
10 | [pageHeight]="pageHeight" | 10 | [pageHeight]="pageHeight" |
11 | (nearOfTop)="onNearOfTop()" (nearOfBottom)="onNearOfBottom()" (pageChanged)="onPageChanged($event)" | 11 | (nearOfTop)="onNearOfTop()" (nearOfBottom)="onNearOfBottom()" (pageChanged)="onPageChanged($event)" |
12 | class="videos" #videoElement | 12 | class="videos" #videosElement |
13 | > | 13 | > |
14 | <div *ngFor="let videos of videoPages" class="videos-page"> | 14 | <div *ngFor="let videos of videoPages" class="videos-page"> |
15 | <my-video-miniature | 15 | <my-video-miniature |
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 4a220c93d..c3543cfaa 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -15,7 +15,7 @@ import { Video } from './video.model' | |||
15 | export abstract class AbstractVideoList implements OnInit, OnDestroy { | 15 | export abstract class AbstractVideoList implements OnInit, OnDestroy { |
16 | private static LINES_PER_PAGE = 3 | 16 | private static LINES_PER_PAGE = 3 |
17 | 17 | ||
18 | @ViewChild('videoElement') videosElement: ElementRef | 18 | @ViewChild('videosElement') videosElement: ElementRef |
19 | @ViewChild(InfiniteScrollerDirective) infiniteScroller: InfiniteScrollerDirective | 19 | @ViewChild(InfiniteScrollerDirective) infiniteScroller: InfiniteScrollerDirective |
20 | 20 | ||
21 | pagination: ComponentPagination = { | 21 | pagination: ComponentPagination = { |
@@ -183,6 +183,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
183 | 183 | ||
184 | // Video takes all the width | 184 | // Video takes all the width |
185 | this.videoWidth = -1 | 185 | this.videoWidth = -1 |
186 | // Same ratios than base width/height | ||
187 | this.videoHeight = this.videosElement.nativeElement.offsetWidth * (this.baseVideoHeight / this.baseVideoWidth) | ||
186 | this.pageHeight = this.pagination.itemsPerPage * this.videoHeight | 188 | this.pageHeight = this.pagination.itemsPerPage * this.videoHeight |
187 | } else { | 189 | } else { |
188 | this.videoWidth = this.baseVideoWidth | 190 | this.videoWidth = this.baseVideoWidth |