Skip to content

PAM Native Media

Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-app --template native
cd my-app
pam composer require pushinbr/pam-native-media
pam doctor
pam native dev
$media = new Media();
$media->probe('media/clip.mp4', fn (?MediaInfo $info, ?string $error) => null);
$media->thumbnail('media/clip.mp4', 'thumbs/clip.jpg', 640, 360, fn (?string $path, ?string $error) => null);

Media probes and thumbnails without loading bytes into PHP; MediaInfo normalizes type, dimensions, duration, and orientation; ThumbnailFormat selects output. Paths are canonical sandbox-relative values. Images honor EXIF orientation and video thumbnails track transforms.

return CameraView::make()
->facing(CameraFacing::Back)
->mode(CameraMode::Photo)
->flash(CameraFlashMode::Off)
->captureRevision($photoRevision)
->onEvent(fn (CameraEventKind $kind, ?CameraCapture $capture, string $message) => null);

Revision commands prevent declarative re-renders from repeating capture. Camera output combinations are mode-specific for device compatibility. Request camera/microphone permission, bound recording duration and storage, and handle returned paths through normal FileReference APIs.

MediaKind classifies probed results. MediaPluginProvider registers the module and camera view automatically during PAM plugin discovery.