Skip to content

Commit

Permalink
chore: add note on how to use in vapor
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Mar 18, 2021
1 parent 800e805 commit b066802
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use Meema\MediaConverter\Facades\MediaConvert;
use Meema\MediaConverter\Jobs\CreateVideoConversion;

# simple usage
MediaConvert::path('video.mkv') // the s3 path to the file inside the bucket defined in your config (filesystems.disks.s3.bucket)
->optimizeForWeb() // will generate an optimized MP4 for you
MediaConvert::path('video.mkv') // the s3 path to the file inside the bucket defined in your config (filesystems.disks.s3.bucket)
->optimizeForWeb() // will generate an optimized MP4 for you
->withThumbnails(int $framerateNumerator, int $framerateDenominator, int $maxCaptures, $width = null, $nameModifier = null, $imageQuality = 80) // will generate thumbnails from the video for you, e.g. poster images
->saveTo('my-optimized-video.mp4'); // output file name
->createJob();
Expand Down Expand Up @@ -212,6 +212,15 @@ Lastly, the second & final step of the "Rule creation" prompts you to enter a na

Now, your API will receive webhooks!

## Deploying to Laravel Vapor

Please note, as of right now, you cannot reuse the AWS credentials stored in your "environment file". The "workaround" for this is to adjust the `media-converter.php`-config file by renaming

From: `AWS_ACCESS_KEY_ID` - To: e.g. `VAPOR_ACCESS_KEY_ID`
From: `AWS_SECRET_ACCESS_KEY` - To: e.g. `VAPOR_SECRET_ACCESS_KEY`

and, lastly, please ensure that your Vapor environment has these values defined.

### Testing

``` bash
Expand Down
5 changes: 5 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

/**
* IAM Credentials from AWS.
*
* Please note, if you are intending to use Laravel Vapor, rename
* From: AWS_ACCESS_KEY_ID - To: e.g. VAPOR_ACCESS_KEY_ID
* From: AWS_SECRET_ACCESS_KEY - To: e.g. VAPOR_SECRET_ACCESS_KEY
* and ensure that your Vapor environment has these values defined.
*/
'credentials' => [
'key' => env('AWS_ACCESS_KEY_ID'),
Expand Down

0 comments on commit b066802

Please sign in to comment.