Skip to content

Commit 9bc192d

Browse files
rcerljenkoRicardo Čerljenkopascalbaljet
authored
Added exception throwing (protonemedia#380)
Co-authored-by: Ricardo Čerljenko <ricardo@lloyds.design> Co-authored-by: pascalbaljet <pascal@pascalbaljet.nl>
1 parent 370bc1f commit 9bc192d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/Drivers/InteractsWithMediaStreams.php

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function getDurationInMiliseconds(): int
4141
if ($format->has('duration')) {
4242
return intval(round($format->get('duration') * 1000));
4343
}
44+
45+
throw new UnknownDurationException('Could not determine the duration of the media.');
4446
}
4547

4648
public function getDurationInSeconds(): int
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace ProtoneMedia\LaravelFFMpeg\Drivers;
4+
5+
use Exception;
6+
7+
class UnknownDurationException extends Exception
8+
{
9+
}

src/Support/FFMpeg.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener fromDisk($disk)
1010
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener fromFilesystem(\Illuminate\Contracts\Filesystem\Filesystem $filesystem)
1111
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener open($path)
12-
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener openUrl($path, array $headers)
12+
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener openUrl($path, array $headers = [])
1313
* @method static \ProtoneMedia\LaravelFFMpeg\MediaOpener cleanupTemporaryFiles()
1414
*
1515
* @see \ProtoneMedia\LaravelFFMpeg\MediaOpener

0 commit comments

Comments
 (0)