Skip to content

Commit

Permalink
more options to preset
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jan 10, 2024
1 parent 0949b79 commit 8c7d4da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Support/VideoPosterConversionPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace Finller\Media\Support;

use FFMpeg\Coordinate\TimeCode;
use Finller\Media\Jobs\VideoPosterConversionJob;
use Finller\Media\MediaConversion;
use Finller\Media\Models\Media;
use Illuminate\Support\Collection;
use Spatie\Image\Enums\Fit;

class VideoPosterConversionPreset
{
Expand All @@ -17,6 +19,10 @@ public static function get(
bool $withResponsiveImages = false,
string $extension = 'jpg',
bool $sync = false,
int|string|TimeCode $seconds = 0,
?int $width = null,
?int $height = null,
Fit $fit = Fit::Max
): Collection {
/**
* @var Collection<int, MediaConversion> $conversions
Expand All @@ -29,6 +35,10 @@ public static function get(
job: new VideoPosterConversionJob(
media: $media,
conversion: 'poster',
seconds: $seconds,
width: $width,
height: $height,
fit: $fit,
fileName: "{$media->name}.{$extension}"
),
conversions: $withResponsiveImages ?
Expand Down

0 comments on commit 8c7d4da

Please sign in to comment.