1. Go to this page and download the library: Download pushinbr/pam-native-media library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pushinbr / pam-native-media example snippets
$media = new Pam\Native\Media\Media();
$media->probe('media/clip.mp4', function (?Pam\Native\Media\MediaInfo $info, ?string $error): void {});
$media->thumbnail('media/clip.mp4', 'thumbs/clip.jpg', 640, 360, function (?string $path, ?string $error): void {});
$camera = CameraView::make()
->facing(CameraFacing::Back)
->mode(CameraMode::Photo)
->flash(CameraFlashMode::Off)
->captureRevision($photoRevision)
->recordRevision($recordRevision)
->stopRevision($stopRevision)
->onEvent(function (CameraEventKind $event, ?CameraCapture $capture, string $message): void {
if ($event === CameraEventKind::Captured && $capture !== null) {
// $capture->path is relative to the app-owned PAM file sandbox.
}
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.