2017-03-03 52 views
0

我使用CKFinder V3与PHP连接器,目前我使用command:sendImageInforetrieve image information宽度和高度在服务器端,例如:如何使用CKFinder检索视频信息?

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

目前我需要对视频使用类似的方法,特别是我需要检索/高度的视频,我找不到任何文档中的参考,我想知道:

  • CKFinder PHP连接器是否支持此功能?如何检索视频尺寸?
  • 如果此功能不受支持,是否可以在后端级别扩展CKFinder,以便它可以提供这些信息?如何从JS API调用它?任何教程或信息?

我知道,在DOM example中插入视频后,可以使用HTML5来获取某些元信息。但我更喜欢服务器端解决方案,欢迎任何其他想法。

回答

1

不幸的是,CKFinder不会处理开箱即用的视频。为了做到这一点,你应该自己开发这样的东西。这将包括:

  1. 服务器端custom command将返回所需的信息。
  2. 客户端插件,将send custom command到服务器。

因此,只需添加一个plugin,将在服务器上添加这样的自定义命令,即VideoInfo。然后在客户端称其为其他命令:

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

同时检查API文档'command:send' request