Skip to content

ui

const ui: {
openPDF: void;
showToolbar: void;
openVideo: Promise<VideoResult>;
};

Defined in: domains/ui.ts:47

openPDF(
pdfPath,
title,
customOptions?): void;

Open a PDF file in the platform viewer.

In the iOS app, opens the native PDF viewer with annotation support. In the browser, opens the file in a new tab.

Parameter Type Description
pdfPath string Path to the PDF file, relative to the presentation root.
title string Display title for the viewer.
customOptions? Record<string, unknown> Optional extra properties passed through to the analytics event.

void

mobilelocker.ui.openPDF('/files/brochure.pdf', 'Product Brochure')
showToolbar(): void;

Show the app navigation toolbar.

void

iOS app only. Throws in all other environments.

MobileLockerError if called outside the iOS app.

openVideo(path, options?): Promise<VideoResult>;

Open a video file in the platform player.

In the iOS app, uses the native AVPlayer with full option support. In the browser, renders a full-viewport <video> overlay. Click outside the video to dismiss it.

Parameter Type Description
path string Path to the video file, relative to the presentation root.
options VideoOptions Playback options (autoplay, loop, controls, speed, etc.).

Promise<VideoResult>

A VideoResult with status and final playback position in seconds.

const result = await mobilelocker.ui.openVideo('/files/demo.mp4', { autoplay: true, showControls: true })
if (result.status === 'completed') console.log(`Watched to ${result.position}s`)