1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-05 14:17:56 +02:00
This commit is contained in:
hakimel
2021-11-24 11:07:11 +01:00
parent ec32d44085
commit c5d549810e
4 changed files with 25 additions and 5 deletions

View File

@@ -279,4 +279,19 @@ export const getRemainingHeight = ( element, height = 0 ) => {
return height;
}
const fileExtensionToMimeMap = {
'mp4': 'video/mp4',
'm4a': 'video/mp4',
'ogv': 'video/ogg',
'mpeg': 'video/mpeg',
'webm': 'video/webm'
}
/**
* Guess the MIME type for common file formats.
*/
export const getMimeTypeFromFile = ( filename='' ) => {
return fileExtensionToMimeMap[filename.split('.').pop()]
}