Unify Logo Footer.svg
Unify Applications
Logo
Media, PDF Viewer & Lottie

Media, PDF Viewer & Lottie

Logo

7 mins READ

Media Block

The Media block displays a set of images and videos as a gallery — a grid or list of tiles that open in a full-screen viewer on click. Content comes in two modes: Static (you supply URLs or bind an array) and Mapped (each media attribute is extracted from fields in your bound data).

Media Source Modes

ModeHow data is providedUse case
StaticSupply URLs directly or bind an array of URLsFixed asset lists, simple bound arrays from APIs
MappedPoint each media attribute (URL, name, caption, file type) at fields of bound objectsRecords with attachment arrays, custom data shapes where URL/type/name are separate fields

Media — Content Properties

PropertyTypeDefaultAppears WhenDescription
type"STATIC" | "MAPPED"STATICAlwaysWhether media items come from direct URLs or from mapped object fields
srcURL string, array of URLs, or array of objects (bindable)type = STATICThe media data. Accepts a single URL, a URL array, or an array of media objects
dataSourcearray of objects (bindable)type = MAPPEDThe bound data array. One gallery tile per item
mappings.urlfield pathtype = MAPPEDField path to the media URL within each object
mappings.namefield pathtype = MAPPEDField path to the media item's display name/caption
mappings.fileTypefield pathtype = MAPPEDField path indicating whether an item is an image or video
interactionsevent listAlwaysOn Click event handler for gallery tile clicks
permissionspermission ruleAlwaysRestrict who sees the block

Media — Appearance Properties

PropertyTypeDefaultDescription
layoutgrid | listgridGrid shows tiles in columns; List shows one tile per row
columnsnumber2Number of columns in grid layout
aspectRatioratio token (1:1, 16:9, 4:3, etc.)1:1Aspect ratio for gallery tiles
showCaptionbooleantrueShow the media item's name/caption below the tile
stylesstyle setWidth, height, margin, padding, gap between tiles
visibilityconditionsShow/hide the block

Video Block

The Video block embeds a single video player. It supports hosted video URLs, autoplay, loop, muted start, poster image, and controls visibility. Use it for a full standalone video experience; for a mixed gallery of images and videos, use the Media block instead.

Video — Key Properties

PropertyTypeDefaultDescription
srcURL string (bindable)The video file URL. Supports mp4, WebM, and other browser-supported formats
posterURL string (bindable)Thumbnail image shown before the video plays
autoplaybooleanfalseStart playing automatically on load. Most browsers require muted = true for autoplay to work
loopbooleanfalseLoop the video when it reaches the end
mutedbooleanfalseStart the video muted. Required for autoplay in most browsers
controlsbooleantrueShow browser-native video controls (play/pause, volume, fullscreen)
objectFitcover | contain | fillcontainHow the video fits within its container box
interactionsevent listOn Click, On Play, On Pause, On End event handlers
visibilityconditionsShow/hide the block

Note: Autoplay requires muted = true in most browsers: Browser autoplay policies block autoplay with sound. Set both autoplay and muted to true for silent autoplay to work reliably.

Audio Player Block

The Audio Player block embeds an audio player for playback of audio files. Use it for voice recordings, music clips, or any audio content bound from your data.

Audio Player — Key Properties

PropertyTypeDefaultDescription
srcURL string (bindable)The audio file URL (mp3, WAV, OGG, etc.)
autoplaybooleanfalseStart playing automatically on load
loopbooleanfalseLoop the audio when it reaches the end
controlsbooleantrueShow built-in playback controls
titlestring (bindable)Display name for the audio track shown above the player
interactionsevent listOn Play, On Pause, On End, On Time Update handlers
visibilityconditionsShow/hide the block

PDF Viewer Block

The PDF Viewer block embeds a PDF document directly in the page, allowing users to read, scroll, and navigate pages without leaving the app. Supports URL-sourced and uploaded PDFs, page navigation controls, and zoom.

PDF Viewer — Key Properties

PropertyTypeDefaultDescription
srcURL string (bindable) or uploaded fileThe PDF source. Can be a URL from your data or an uploaded file from the builder
initialPagenumber1Which page to show when the viewer first loads
showToolbarbooleantrueShow the built-in toolbar with page navigation, zoom, and download controls
fitMode"width" | "page" | "height"widthHow the PDF page fits in the viewer area
stylesstyle setWidth, height (set an explicit height for the viewer to have a scrollable area)
interactionsevent listOn Page Change event handler
permissionspermission ruleRestrict who sees the block

Warning: Set an explicit height: The PDF Viewer needs a defined height to create a scrollable viewing area. Without a height, it may collapse to zero or show only a single page. Use Styles → Height (e.g., 600px or 80vh).

PDF Viewer — Examples

Lottie Animation Block

The Lottie Animation block renders Lottie JSON animations — lightweight, scalable vector animations — directly in the page. Control playback speed, looping, autoplay, and direction. Use for loading animations, success celebrations, empty-state illustrations, or any motion graphic.

Lottie Animation — Key Properties

PropertyTypeDefaultDescription
srcURL string or uploaded JSON (bindable)The Lottie JSON animation file. Supports a URL to a .json file or an uploaded file
autoplaybooleantrueStart the animation automatically when loaded
loopboolean | numbertrueLoop the animation. Set to a number to repeat a specific number of times
speednumber1Playback speed multiplier. 1 = normal, 2 = double speed, 0.5 = half speed
direction"forward" | "backward"forwardPlayback direction
hoverbooleanfalsePlay animation only while the mouse hovers over it
stylesstyle setWidth and height of the animation canvas. Lottie scales to fit
visibilityconditionsShow/hide the block
permissionspermission ruleRestrict who sees the block

Lottie Animation — Methods

MethodDescription
playStart or resume the animation
pausePause the animation at the current frame
stopStop and reset to the first frame
goToAndPlay(frame)Jump to a specific frame and play from there
goToAndStop(frame)Jump to a specific frame and pause

Lottie — Examples

Which Block to Use for Media

You want to…Use
Display a browsable gallery of images and videosMedia
Show one standalone video with a full playerVideo
Play an audio file with controlsAudio Player
Embed a PDF document in the pagePDF Viewer
Display a Lottie JSON vector animationLottie Animation
Show one static imageImage
Display a swipeable set of media slidesCarousel

Frequently Asked Questions

My PDF Viewer shows only a blank area. What is wrong?

The most common cause is a missing explicit height. PDF Viewer does not auto-size to its content — you must set a fixed height (e.g., 600px or 80vh) on the block or its parent container. The second common cause is a CORS restriction on the PDF URL; host the PDF on the same origin or a CDN that sets permissive CORS headers.

Why doesn't my video autoplay?

Modern browsers block autoplay with audio. Set Muted to true alongside Autoplay — muted autoplay is allowed by all major browsers. If you need audio to start immediately (e.g., a news clip), prompt the user to interact first (a play button overlay), then start playback on their tap/click using JavaScript or an On Click action.

How do I trigger a Lottie animation from a button click?

Expose the Lottie block's methods by giving it a block ID. On the button's On Click event, add a Control block action, select the Lottie block, and choose the Play method. To reset it, call Stop first (which returns to frame 0), then call Play. Set Autoplay to false if you only want the animation to run on demand.

Can I show a thumbnail image before a Video block loads?

The Video block does not have a native poster/thumbnail property. As a workaround, overlay an Image block on top of the Video (both in the same container with the Image positioned absolutely) and hide the Image on the video's On Click or On Play event, revealing the video underneath.