2018-11-04 19:28:32 +01:00
|
|
|
import {Media} from '../Media';
|
|
|
|
import {MediaDTO} from '../../../../common/entities/MediaDTO';
|
|
|
|
import {OrientationTypes} from 'ts-exif-parser';
|
|
|
|
import {PhotoDTO} from '../../../../common/entities/PhotoDTO';
|
2018-11-22 19:12:10 +01:00
|
|
|
import {VideoDTO} from '../../../../common/entities/VideoDTO';
|
2018-11-04 19:28:32 +01:00
|
|
|
|
|
|
|
export class GridMedia extends Media {
|
|
|
|
|
|
|
|
|
|
|
|
constructor(media: MediaDTO, renderWidth: number, renderHeight: number, public rowId: number) {
|
|
|
|
super(media, renderWidth, renderHeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
public get Orientation(): OrientationTypes {
|
|
|
|
return (<PhotoDTO>this.media).metadata.orientation || OrientationTypes.TOP_LEFT;
|
|
|
|
}
|
|
|
|
|
|
|
|
isPhoto(): boolean {
|
2018-11-17 19:32:31 +01:00
|
|
|
return MediaDTO.isPhoto(this.media);
|
2018-11-04 19:28:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
isVideo(): boolean {
|
2018-11-17 19:32:31 +01:00
|
|
|
return MediaDTO.isVideo(this.media);
|
2018-11-04 19:28:32 +01:00
|
|
|
}
|
|
|
|
|
2018-11-22 19:12:10 +01:00
|
|
|
get Video(): VideoDTO {
|
|
|
|
return <VideoDTO>this.media;
|
|
|
|
}
|
|
|
|
|
2018-11-04 19:28:32 +01:00
|
|
|
|
|
|
|
}
|