src/Factory/AssetFactory.php
private static function createAssetsForVideo(array $assets): array
    {
        $result = [];

        if (empty($assets)) {
            return $result;
        }
        
        $videos = array_values(array_map(function (array $video) {
            return (new Asset())
                ->setType(Asset::TYPE_VIDEO)
                ->setScale($video['scale'])
                ->setSource($video['source'])
                ->setVersion($video['type'])
                ;
        }, $assets['video']));

        $result = array_merge($videos, $result);

        foreach ($assets['audio'] as $key => $path) {
            $result[] = (new Asset())
                ->setType(Asset::TYPE_AUDIO)
                ->setScale(null)
                ->setVersion($key)
                ->setSource($path)
            ;
        }

        return $result;
    }
private static function createAssetsForVideo(array $assets): array
    {
        $result = [];

        if (empty($assets)) {
            return $result;
        }
        
        $videos = array_values(array_map(function (array $video) {
            return (new Asset())
                ->setType(Asset::TYPE_VIDEO)
                ->setScale($video['scale'])
                ->setSource($video['source'])
                ->setVersion($video['type'])
                ;
        }, $assets['video']));

        $result = array_merge($videos, $result);

        foreach ($assets['audio'] as $key => $path) {
            $result[] = (new Asset())
                ->setType(Asset::TYPE_AUDIO)
                ->setScale(null)
                ->setVersion($key)
                ->setSource($path)
            ;
        }

        return $result;
    }
@param array $assets

@return Asset[]