2020-08-20 02:10:42 +02:00
|
|
|
import { Dimensions } from '../classes/Dimensions';
|
|
|
|
import { env } from '../env';
|
|
|
|
export function getMediaDimensions(input) {
|
|
|
|
const { Image, Video } = env.getEnv();
|
2020-08-18 14:04:33 +02:00
|
|
|
if (input instanceof Image) {
|
2020-08-20 02:10:42 +02:00
|
|
|
return new Dimensions(input.naturalWidth, input.naturalHeight);
|
2020-08-18 14:04:33 +02:00
|
|
|
}
|
|
|
|
if (input instanceof Video) {
|
2020-08-20 02:10:42 +02:00
|
|
|
return new Dimensions(input.videoWidth, input.videoHeight);
|
2020-08-18 14:04:33 +02:00
|
|
|
}
|
2020-08-20 02:10:42 +02:00
|
|
|
return new Dimensions(input.width, input.height);
|
2020-08-18 14:04:33 +02:00
|
|
|
}
|
|
|
|
//# sourceMappingURL=getMediaDimensions.js.map
|