0

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;
    }
}
Radex
  • 7,815
  • 23
  • 54
  • 86
  • Possible duplicate of [http://stackoverflow.com/questions/4847752/how-to-get-video-duration-dimension-and-size-in-php] – Mani7TAM Mar 03 '17 at 12:27
  • Possible duplicate of [How to get video duration, dimension and size in PHP?](http://stackoverflow.com/questions/4847752/how-to-get-video-duration-dimension-and-size-in-php) – Rushil K. Pachchigar Mar 03 '17 at 12:28
  • Thanks for point me out your links but I believe my question is different as I do not want to use getID3 and instead use CKFINDER – Radex Mar 03 '17 at 12:41

0 Answers0