Skip to content

BaseMediaPreview

Component allowing for the display of images or streaming of audio and video (currently only hls format) and by using browser pdf viewer also pdfs

CAVEAT: this component will be deprecated and replaced by BaseMediaCarousel! Usage not recommended!

Props

Prop nameDescriptionTypeValuesDefault
showPreviewsteer the display of the lightboxboolean-false
mediaUrlurl of the medium to be displayedstring-''
mediaPosterUrlurl of image for poster property in html5 video tagstring-''
displayNamefilename that will be displayed for the mediumstring-''
downloadUrlurl for downloading the filestring-''
mediaTypedefine the media typestringimage, video, audio, pdf''
displaySizeset height and with from outsideobject-{
height: '720px',
width: '1280px'
}
allowDownloaddefine if download button should be shown and download be enabledboolean-true
infoTextsdefine information texts for download and view (for pdfs) buttonsobject-{
download: 'Download',
view: 'View'
}
orientationdefine how the image should be rotated (EXIF orientation values)number-0
previewsspecify an image srcset as an array of objects in the form
{ [mediawidth]: 'url' }
array-[]
additionalInfoAdditional info text below file namearray-[]
hlsStartLevelset initial hls-video sizenumber-undefined

Events

Event namePropertiesDescription
hide-previewtriggered on clicking outside image area or when close action is triggered
downloadurl string - the download url
name string - the file name
download button clicked

Demo

Image View Box

An audio example

An video example

An pdf example