🚧 Add stream to map
Still need to handle the codecs. But almost there.
This commit is contained in:
parent
90906a517d
commit
de5cf914da
4 changed files with 113 additions and 8 deletions
21
src/Traits/HasMetadata.php
Normal file
21
src/Traits/HasMetadata.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Danjones\FFMpeg\Traits;
|
||||
|
||||
trait HasMetadata
|
||||
{
|
||||
protected array $metadata = [];
|
||||
|
||||
public function addMetadata(array|string $keyOrData, string $value = null): static
|
||||
{
|
||||
if (is_array($keyOrData)) {
|
||||
array_walk($keyOrData, fn($v, $k) => $this->addMetadata($k, $v));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->metadata[$keyOrData] = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue