vkr/multimedia-analyzer-bundle
Composer 安装命令:
composer require vkr/multimedia-analyzer-bundle
包简介
A bundle for Symfony2/3 that analyzes multimedia file duration using GetID3
README 文档
README
This is a very simple bundle that currently does just one thing - gets the length of a video or audio file in seconds. It has a dependency on VKRSettingsBundle and it also depends on an object-oriented version of GetID3 library. The dependency on GetID3 is my fork of phansys/getid3 that is compatible with PHP 7.
Installation
Nothing to install except for standard Symfony bundle installation procedure.
Usage
There is just a single public method that needs to be called as follows:
$analyzer = $this->get('vkr_multimedia_analyzer.multimedia_duration_analyzer');
$file = new Symfony\Component\HttpFoundation\File('/path/to/file');
try {
$length = $analyzer->getFileDuration($file);
} catch (MultimediaAnalyzerException $e) {
// handle exception
}
If the file is not a multimedia file, 0 will be returned.
You may also use VKRSettingsBundle in this manner:
$maximumLengthSetting = 'maximum_length';
$length = $analyzer->getFileDuration($file, $maximumLengthSetting);
Here, if the file duration is longer than maximum, MultimediaAnalyzerException
will be thrown.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-09