leela/video-api
Composer 安装命令:
composer require leela/video-api
包简介
Gets the Videos from all the major video sharing websites. Supports Youtube, Dialymotion and Vimeo
README 文档
README
API for the video websites such as youtube, Vimeo and dailymotion
Uses Strategy Design Pattern
Begin by installing this package through Composer. Edit your project's composer.json file to require`.
"require": {
"leela/VideoApi": "0.1"
}
Next, update Composer from the Terminal:
composer update
That's it! You're all set to go.
Usage for youtube video details
<?php
$youtubeapi = new \Leela\VideoApi(new \Leela\Services\YouTubeService());
$youtubeapi->getVideoDetails('x2on26a');
Usage for Vimeo video details
<?php
$vimeoapi = new \Leela\VideoApi(new \Leela\Services\VimeoService());
$vimeoapi->getVideoDetails('x2on26a');
Usage for Daily Motion video details
<?php
$dailymotionapi = new \Leela\VideoApi(new \Leela\Services\DailyMotionService());
$dailymotionapi->getVideoDetails('x2on26a');
Methods
1) getVideoDetails($videoId);
$videoId - Video Id of the youtube, Vimeo or the daily motion
Returns array of video details
array(
'id' => $data->id,
'title' => $data->title,
'description' => $data->description,
'thumbnail_small' => $data->thumbnail->sqDefault,
'thumbnail_large' => $data->thumbnail->hqDefault,
'duration' => $data->duration,
'upload_date' => $data->uploaded,
'like_count' => isset($data->likeCount) ? $data->likeCount : 0,
'view_count' => isset($data->viewCount) ? $data->viewCount : 0,
'comment_count' => isset($data->commentCount) ? $data->commentCount : 0,
'uploader' => $data->uploader
);
2) getPlayer($videoId, $width, $height)
$videoId - Required (Video id of the youtube, Vimeo or the dailymotion)
$width - Optional (width of the player)
$height - Optional (height of the player)
Returns the html data of the player
Contributor
Leela Narasimha Reddy - leela@leelag.com
Issues & Suggestions
Please report any bugs or feature requests here: https://github.com/leelanarasimha/VideoApi/issues
leela/video-api 适用场景与选型建议
leela/video-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 leela/video-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leela/video-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-04