Mobile Locker JavaScript SDK
    Preparing search index...

    Variable uiConst

    ui: {
        openPDF(
            pdfPath: string,
            title: string,
            customOptions?: Record<string, unknown>,
        ): void;
        showToolbar(): void;
        openVideo(path: string, options?: VideoOptions): Promise<VideoResult>;
    } = ...

    Type Declaration

    • openPDF: function
      • 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

        • pdfPath: string

          Path to the PDF file, relative to the presentation root.

        • title: string

          Display title for the viewer.

        • OptionalcustomOptions: Record<string, unknown>

          Optional extra properties passed through to the analytics event.

        Returns void

        mobilelocker.ui.openPDF('/files/brochure.pdf', 'Product Brochure')
        
    • showToolbar: function
      • Show the app navigation toolbar.

        Returns void

        iOS app only. Throws in all other environments.

        MobileLockerError if called outside the iOS app.

    • openVideo: function
      • 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

        • path: string

          Path to the video file, relative to the presentation root.

        • options: VideoOptions = {}

          Playback options (autoplay, loop, controls, speed, etc.).

        Returns 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`)