I need to retrieve some video information as width and height from PHP.
I am currently using this code but it returns size in byte but not dimension width and height (I think issue is related to getMetadata).
Could you point me out how to change my code and retrieve this infos? Thanks all.
Notes: this question is different from other because it require the use of CKFinder.
<?php
namespace CKSource\CKFinder\Plugin\GetVideoInfo;
use CKSource\CKFinder\Acl\Permission;
use CKSource\CKFinder\CKFinder;
use CKSource\CKFinder\Command\CommandAbstract;
use CKSource\CKFinder\Error;
use CKSource\CKFinder\Filesystem\Folder\WorkingFolder;
use CKSource\CKFinder\Filesystem\Path;
use CKSource\CKFinder\Plugin\PluginInterface;
use Symfony\Component\HttpFoundation\Request;
class GetVideoInfo extends CommandAbstract implements PluginInterface
{
protected $app;
protected $requires = [
Permission::FILE_VIEW
];
public function getDefaultConfig()
{
return [];
}
public function execute(Request $request, WorkingFolder $workingFolder)
{
$fileName = $request->get('fileName');
$backend = $workingFolder->getBackend();
if (!$workingFolder->containsFile($fileName)) {
throw new \Exception('File not found', Error::FILE_NOT_FOUND);
}
$fileMetadada = $backend->getMetadata(Path::combine($workingFolder->getPath(), $fileName));
return $fileMetadada;
}
}