ui
const ui: { openPDF: void; showToolbar: void; openVideo: Promise<VideoResult>;};Defined in: domains/ui.ts:47
Type Declaration
Section titled “Type Declaration”openPDF()
Section titled “openPDF()”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.
Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.ui.openPDF('/files/brochure.pdf', 'Product Brochure')showToolbar()
Section titled “showToolbar()”showToolbar(): void;Show the app navigation toolbar.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
openVideo()
Section titled “openVideo()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path |
string |
Path to the video file, relative to the presentation root. |
options |
VideoOptions |
Playback options (autoplay, loop, controls, speed, etc.). |
Returns
Section titled “Returns”Promise<VideoResult>
A VideoResult with status and final playback position in seconds.
Example
Section titled “Example”const result = await mobilelocker.ui.openVideo('/files/demo.mp4', { autoplay: true, showControls: true })if (result.status === 'completed') console.log(`Watched to ${result.position}s`)