feat(server): Support webm videos (#1365)

* feat(server): Support webm without transcoding.

Transcoding result doesn't appear to be used by anything expect for quicktime.

* feat(server): Fix the asset uploader for .avi

It needs to be transcoded.

* feat(server): Most browsers doesn't support avi so use mp4.

* feat(server): Address PR comments

* Addressed the PR comments

I moved the function that checks the mimetype to a central location in asset-utils and made tests for it.

* Rollbacked to the way transcoder was decising things to transcode.
This commit is contained in:
Skyler Mäntysaari
2023-01-21 23:52:40 +02:00
committed by GitHub
parent 5262e92b9f
commit 8eb82836b9
5 changed files with 39 additions and 4 deletions

View File

@@ -36,4 +36,13 @@ const deleteFiles = (asset: AssetEntity | AssetResponseDto) => {
}
};
export const assetUtils = { deleteFiles };
const isWebPlayable = (mimeType: string | null): boolean => {
const WEB_PLAYABLE = ['video/webm', 'video/mp4'];
if (mimeType !== null) {
return WEB_PLAYABLE.includes(mimeType);
}
return false;
};
export const assetUtils = { deleteFiles, isWebPlayable };