Skip to content

Retrieve Mimetype

When working with media assets in CE.SDK, it is often necessary to determine the mimetype of a resource before processing it. This guide explains how to use the getMimeType(uri: Uri) function to retrieve the mimetype of a given resource.

Returns the mimetype of the resources at the given Uri.

If the resource is not already downloaded, this function will download it.

  • uri: the Uri of the resource.
  • Returns the mimetype of the resource.
// Get the mimetype of a resource
const mimeType = await engine.editor.getMimeType(
'https://cdn.img.ly/assets/demo/v1/ly.img.image/images/sample_1.jpg',
);