also looking at this
meemalabs/laravel-media-converter
fix: too few arguments in MediaConvert::createJob()
#22
3 files
+21
-4
| @@ -146,8 +146,12 @@ class MediaConvert implements Converter | ||
| 146 | 146 | * @param int $priority |
| 147 | 147 | * @return \Aws\Result |
| 148 | 148 | */ |
| 149 | public function createJob(array $settings, array $metaData = [], array $tags = [], int $priority = 0) | |
| 149 | public function createJob(array $settings = [], array $metaData = [], array $tags = [], int $priority = 0) | |
| 150 | 150 | { |
| 151 | if (empty($settings)) { | |
| 152 | $settings = $this->jobSettings; | |
| 153 | } | |
| 154 | ||
| 151 | 155 | return $this->client->createJob([ |
| 152 | 156 | 'Role' => config('media-converter.iam_arn'), |
| 153 | 157 | 'Settings' => $settings, |
| @@ -71,9 +71,23 @@ it('can successfully create a job', function () { | ||
| 71 | 71 | $this->assertEquals($response['@metadata']['statusCode'], 201); |
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | it('can successfully get a job', function () { | |
| 74 | it('can successfully create a job chained', function () { | |
| 75 | $inputName = 'my-video.mkv'; | |
| 76 | $outputName = 'my-video.mp4'; | |
| 77 | $bucket = 'test-bucket'; | |
| 78 | ||
| 79 | $response = MediaConvert::path($inputName, 'test-bucket') | |
| 80 | ->optimizeForWeb() | |
| 81 | ->withThumbnails(1, 2, 3, 100) | |
| 82 | ->saveTo($outputName, $bucket) | |
| 83 | ->createJob(); | |
| 84 | ||
| 85 | $this->assertEquals($response['@metadata']['statusCode'], 201); | |
| 86 | }); | |
| 87 | ||
| 88 | it('can successfully get a jobs', function () { | |
| 75 | 89 | // just a hardcoded job ID retrieved from one of the AWS MediaConvert jobs |
| 76 | $jobId = '1615614565083-g1cgjm'; | |
| 90 | $jobId = '1627096589458-nqj4pr'; | |
| 77 | 91 | |
| 78 | 92 | $response = MediaConvert::getJob($jobId); |
| 79 | 93 | |