Search code examples
phpckfinder

How to retrieve video information using CKFinder?


I am using CKFinder V3 with PHP Connector, currently I am using command:send and ImageInfo to retrieve image information as width and height at server side, example:

this._ckFinder.request('command:send', {
                    name: 'ImageInfo',
                    folder: file.get('folder'),
                    params: { fileName: file.get('name') }
                })...

Currently I need to use a similar approach for video, specially I need to retrieve video with/height and I could not find any reference in the doc, I would like to know:

  • Does CKFinder PHP Connector support this feature? How to retrieve video dimensions?
  • If this feature is not supported, is possible to extend CKFinder at back-end level so it can provide these information? How to call this from JS API? Any tutorial or info?

I am aware that is possible to use HTML5 to get some meta information after a video has been inserted in the DOM example. But I rather prefer a server side solution any other ideas is welcome.


Solution

  • Unfortunately CKFinder does not process videos out of the box. In order do that you should develop such thing by your own. This would consist:

    1. Server side custom command that will return required information.
    2. Client side plugin that will send custom command to the server.

    So just add a plugin that will add such custom command on server, ie VideoInfo. Then on the client side call it as other commands:

    finder.request( 'command:send', {
        name: 'VideoInfo',
        folder: file.get( 'folder' ),
        params: {
            fileName: file.get( 'name' )
        }
    } ).done( function( response ) {
        // Process the response
    } );
    

    Also check API docs for 'command:send' request.