🚧 Add stream to map

Still need to handle the codecs. But almost there.
This commit is contained in:
Dan Jones 2022-08-23 15:25:27 -05:00
commit de5cf914da
4 changed files with 113 additions and 8 deletions

View 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;
}
}