You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add Laravel Event System integration for media processing
- Add MediaProcessingStarted, MediaProcessingProgress, MediaProcessingCompleted, and MediaProcessingFailed events
- Events fire automatically during all media processing operations including HLS exports
- Add enable_events configuration option (defaults to true)
- Events include input media collection, output path, and processing metadata
- Progress events include real-time percentage, remaining time, and processing rate
- Update README with comprehensive event system documentation
- Add FFmpeg 7.x compatibility while maintaining support for 4.4 and 5.0
- Fix HLS test patterns to handle AVERAGE-BANDWIDTH field in newer FFmpeg versions
The package fires Laravel events during media processing, enabling you to build reactive workflows and real-time progress monitoring. You can listen for these events to trigger notifications, update databases, or integrate with WebSocket broadcasting.
129
+
130
+
#### Available Events
131
+
132
+
-**`MediaProcessingStarted`** - Fired when encoding begins
133
+
-**`MediaProcessingProgress`** - Fired during encoding with real-time progress updates
134
+
-**`MediaProcessingCompleted`** - Fired when encoding completes successfully
135
+
-**`MediaProcessingFailed`** - Fired when encoding encounters an error
136
+
137
+
#### Event Properties
138
+
139
+
Each event contains:
140
+
-`inputMedia` - Collection of input media files
141
+
-`outputPath` - The target output file path (when available)
142
+
-`metadata` - Additional processing context
143
+
144
+
Progress events additionally include:
145
+
-`percentage` - Completion percentage (0-100)
146
+
-`remainingSeconds` - Estimated time remaining
147
+
-`rate` - Processing rate
148
+
149
+
#### Listening for Events
150
+
151
+
```php
152
+
use ProtoneMedia\LaravelFFMpeg\Events\MediaProcessingCompleted;
153
+
use ProtoneMedia\LaravelFFMpeg\Events\MediaProcessingProgress;
154
+
155
+
// Listen for completion to send notifications
156
+
Event::listen(MediaProcessingCompleted::class, function ($event) {
You can open uploaded files directly from the `Request` instance. It's probably better to first save the uploaded file in case the request aborts, but if you want to, you can open a `UploadedFile` instance:
0 commit comments