Skip to content

BaseMediaCarousel

Component for browsing various file formats. Supports images, audio, video (currently HLS only), and PDF through dedicated viewers. For unknown formats, a preview image is shown when available, with an option to download the file.

Props

Prop nameDescriptionTypeValuesDefault
itemsitems to display in a swiper carousel

array of objects with the following required properties:
title string - the asset title
mediaUrl string - url of the medium to be displayed

additionally, type video also requires the following properties:
mediaPosterUrl string - url of image for poster property in html5 video tag
displaySize Object - set height and with from outside, needs to be an object with properties height and/or width.

optional properties:
additionalInfo string[] - additional info text below file name, an array of strings.
downloadUrl string - url for downloading the file
mediaType string - specify the media type - needs to be one of: image, video, audio, pdf. Caveat: if media type is not specified it is automatically determined from file ending!
orientation number - define how the image should be rotated (EXIF orientation values) (only for type image)
previews Object[] - specify an image srcset as an array of objects in the form { [mediawidth]: 'url' } (only for type image)
hlsStartLevel number - define startLevel (size) of hls-video
thumbnail string - url of a preview image, used for files for which no special viewer is available
array-[]
initialSlideindex of initial slide
this NEEDS to be provided if carousel should start with any other
than first image in items array
number|string-0
allowDownloaddefine if download button should be shown and download be enabledboolean-true
infoTextsdefine information texts
e.g. for download and view (for pdfs) buttons or error messages
object-{
download: 'Download',
view: 'View',

error: {
pdf: 'The PDF couldn’t be opened in the PDF-Viewer.',
}
}
showPreviewsteer the display of the lightboxboolean-false
swiperOptionsspecify swiper API optionsobject-{
speed: 500,

keyboard: {
enabled: true,
}
}
pdfInitialWidthdefine the initial width (in pixels) for pdf pagesnumber-1000
pdfZoomWidthdefines the width (in pixels) of PDF pages in zoom modenumber-2500
zoomMaxdefine the max zoom factor in %number-250

Events

Event namePropertiesDescription
downloadurl string - the download url
name string - the file name
download button clicked
hidetriggered by clicking on close button

Demo