corbpie/gumlet-api
Composer 安装命令:
composer require corbpie/gumlet-api
包简介
Gumlet video hosting API wrapper
README 文档
README
Please note that this package is still in progress!
Table of contents
Features
Create and update videos & profiles...
Installing and Usage
Install with composer:
composer require corbpie/gumlet-api
Use like:
require __DIR__ . '/vendor/autoload.php'; use Corbpie\Gumlet; $gm = new Gumlet\GumletVideo();
Setting API key:
Line 7 GumletBase.php
const API_KEY = 'XXXX-XXXX-XXXX';
Video
List Profiles
$gm->listProfiles();
Set Profile
Requires $gm->profile_id to be set
$gm->profile_id = 'TJQuvxBnOcxQwnPOWc';
Get Profile
Requires $gm->profile_id to be set
$gm->getProfile();
Create a Profile
$parameters = [ 'description' => 'The description for this new profile', 'mp4_access' => true ]; $format = 'HLS';//HLS, MPEG-DASH, MP4 $gm->createProfile('the-new-profile-name', $format, $parameters);
List videos
Requires $gm->video_collection to be set
$gm->listVideos();
Get video details
$gm->video_id = '65f1819d759d13a91c0a4c09'; echo json_encode($gm->getVideo());
Create video from a URL
Requires $url and $gm->video_collection
$gm->createVideoFromUrl($url, $format, $parameters);
Inputs:
Note setting $gm->profile_id will override everything except the $url and the collection id
string $url The URL to download the video from to use.
string $format Format for the video encoding "HLS, MPEG-DASH and MP4" ONLY!
array $parameters Optional values for the video creation:
[
'tag'=> 'example, another',
'title'=> 'title to video',
'description'=> 'This video is all about XYZ',
'width'=> '75%',
'height'=> '75%',
'resolution'=> '720p',
'mp4_access'=> true,
'per_title_encoding'=> false,
'process_low_resolution_input'=> true,
'audio_only'=> false,
'enable_drm'=> true
]
Example for creating a video from URL with multiple audio tracks:
$parameters = [ 'profile_id' => '65138fa952ccfd817db2a665', 'title' => 'The title for this great video', 'description' => 'The description for this great video', 'mp4_access' => false, 'audio_only' => false, 'additional_tracks' => [ [ 'url' => 'https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac', 'type' => 'audio', 'language_code' => 'en', 'name' => 'English'], [ 'url' => 'https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac', 'type' => 'audio', 'language_code' => 'pl', 'name' => 'Polish' ] ] ]; $video = $gm->createVideoFromUrl( 'https://domain.com/video.mp4', 'MP4', $parameters );
Update thumbnail from frame
$gm->video_id = '65f1819d759d13a91c0a4c09'; $frame = 20; $gm->updateVideoThumbnailFromFrame($frame);
Update video title
$gm->video_id = '65f1819d759d13a91c0a4c09'; $gm->updateVideoTitle('The new title for this video');
Update video description
$gm->video_id = '65f1819d759d13a91c0a4c09'; $gm->updateVideoDescription('The new description for this video');
Delete video
$gm->video_id = '65f1819d759d13a91c0a4c09'; $gm->deleteVideo();
corbpie/gumlet-api 适用场景与选型建议
corbpie/gumlet-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 corbpie/gumlet-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 corbpie/gumlet-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-15