Skip to main content

Extract Media

Extracted Data#

The media extraction API allows to retrieve media info from the content, in the following formats:

Image info#

propertyinfo
imageUrlthe absolute URL for the original size image
imageHeightimage height in pixels
imageWidthimage width in pixels
imageAltimage alt, if set by the user
imageCaptionimage caption, if set by the user

Video info#

propertyinfo
videoThumbnailUrlA thumbnail image relevant to the video
videoContentUrlActual bytes of the video file

Usage#

import { extractMedia } from 'ricos-content/libs/extract-media';
...
const mediaItems = extractMedia(draftContent);

Availability#

ricos-content v8.37.0 and higher