Contribute to Docs Contribute to Docs

Media Preview

When previewing media, the modal will show a preview if the media if supported (see section Media Types below). The modal also support view some more details information about the media item and the options to update the media item by uploading a new file that will replace the current one.

Methods

Open

Preview media that has been uploaded to the media library by calling the open method with the media.id as a parameter.

piranha.preview.open(mediaId);

Media types

Image

Images will be displayed using an img element.

Document

Documents will be loaded via an iframe to the let the browser handling the previewing.

Video

Videos will be previewing using a video element.

Audio

There is no support for previewing audio at this moment, coming soon.

Other

All other media types will not show a preview of the media, instead the user will be presented with public URL or downloading options.