myInfiniteScroller
[pageHeight]="pageHeight"
(nearOfTop)="onNearOfTop()" (nearOfBottom)="onNearOfBottom()" (pageChanged)="onPageChanged($event)"
- class="videos" #videoElement
+ class="videos" #videosElement
>
<div *ngFor="let videos of videoPages" class="videos-page">
<my-video-miniature
export abstract class AbstractVideoList implements OnInit, OnDestroy {
private static LINES_PER_PAGE = 3
- @ViewChild('videoElement') videosElement: ElementRef
+ @ViewChild('videosElement') videosElement: ElementRef
@ViewChild(InfiniteScrollerDirective) infiniteScroller: InfiniteScrollerDirective
pagination: ComponentPagination = {
// Video takes all the width
this.videoWidth = -1
+ // Same ratios than base width/height
+ this.videoHeight = this.videosElement.nativeElement.offsetWidth * (this.baseVideoHeight / this.baseVideoWidth)
this.pageHeight = this.pagination.itemsPerPage * this.videoHeight
} else {
this.videoWidth = this.baseVideoWidth