mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-05 14:17:56 +02:00
refactor #3078
This commit is contained in:
@@ -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()]
|
||||
}
|
Reference in New Issue
Block a user