承接 arvan/vod-client-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arvan/vod-client-sdk

Composer 安装命令:

composer require arvan/vod-client-sdk

包简介

This is a client package to make your development process more faster.

README 文档

README

This is forked because composer wasn't able to download the main package

This package has written in pure php which can be implemented in any PHP framework.

For more details please kindly take a look at the API Doc

  1. The Package has too registered
class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     */
    public function boot()
    {
    }

    /**
     * Register any application services.
     */
    public function register()
    {
        $this->app->bind('arvan-vod-sdk', function ($app) {
            return VodSdk::setToken('Apikey xxxxxxxxxxxx');
        });
    }
}

// SomeController.php

$vodSdk = app('arvan-vod-sdk');
  1. UserDomain:
**
* UserDomain:
* There are only two end points for userDomains (create and show).
* please be informed that, create action is only available for just one time and if a user wants to change
* their userDomain, they need to cantact to Arvan support.
*/
 
// POST
$userDomain = $vodkSdk->userDomain();

$createdDomain = $userDomain->createDomain(['subdomain' => 'whatever']);

// GET
$getUserDomain = $userDomain->getDomain(); 
  1. Channel:
**
* in order to create a channel create method is available which accepts and array as the sample in below
*/
 
// Post

$channel = $vodSdk->channel();
$newChannel = $channel-> create([
    'title' => 'string',
    'description' => 'string',
    'secure_link_enabled' => false,
    'secure_link_key' => 'string',
    'secure_link_with_ip' => true,
    'ads_enabled' => false,
    'present_type' => 'auto',
    'campaign_id' => 'string'
]);

// GET (all channels)
$allChannels = $channel->showAll();

// GET (get specific channhel by id)
$channelDetails = $channel->show('********-****-****-****-********')

// PATCH (update a channel)
$updatedChannel = $channel->update('5c6b18de-9763-423f-8d3e-f2e84e93c9d5', [
    'title' => 'whatever from sdk'
    ]);
    
// DELETE (delete a channel) 
$channel->update('********-****-****-****-********');
  1. File:
// GET (get the whole channel files)
$channelId = 'xxxx-xxxx-xxxx-xxxx';
$file = $vodSdk->file();
$allChannelFiles = $file->showAll($channelId) // channel ID must be set as a string

$music = storage_path('music.mp3');
$storageUrl = $file->createStorage($channelId, $music);

**
* response will be file id and URL, URL can be used to get file offset
* in order to findout whether the file is completely uploaded or not.
*/
$uploadedFile = $file->upload($storageUrl);

// HEAD (Uploaded file url is required)
$fileOffset = $file->getOffset('https://napi.arvancloud.com/**************');

// DELETE (by file ID)
$file->delete('********-****-****-****-********');
  1. Video / Audio:
$channelId = 'xxxx-xxxx-xxxx-xxxx';
$fileId = 'xxxx-xxxx-xxxx-xxxx';
$video = $file->video();

// GET (get the whole channel videos)
$allChannelVideos = $video->showAll($channelId);

// GET (get specific video by ID)
$getVideo = $video->showAll('********-****-****-****-********');  //VideoId

// POST (convert an uploaded file / upload with an address (URL)
$newVideo = $video->create([
    [
        'title' => 'string',
        'description' => 'string',
        'video_url' => 'string', // should be null or removed if file_id is exist 
        'file_id' => 'string',
        'convert_mode' => 'auto/manual/profile',
        'profile_id' => 'string',
        'parallel_convert' => false,
        'thumbnail_time' => 0,
        'watermark_id' => 'string',
        'watermark_area' => 'CENTER', // required if watermark_id is set
        'convert_info' => [         // required if convert_mode is manual
            [
                'audio_bitrate' => 0,
                'video_bitrate' => 0,
                'resolution' => 'string'
            ],
            [
                'audio_bitrate' => 0,
                'video_bitrate' => 0,
                'resolution' => 'string'
            ],
            [
                'audio_bitrate' => 0,
                'video_bitrate' => 0,
                'resolution' => 'string'
            ]
        ]
    ]
]);

// PATCH (update video or audio. Only title and description are editable)
$updatedVideo = $video->update('video_id', [
    'title' => 'whatever',
    'description' => 'something...'
]);

// DELETE (by video / audio ID)
$video->delete('********-****-****-****-********');
  1. Watermark:
// GET (get all channel watermarks)
$channelId = 'xxxx-xxxx-xxxx-xxxx';
$watermark = $vodSdk->watermark();
$allChannelWarermark = $watermark->showAll($channelId) // channel ID must be set as a string

// GET (get specific watermkark)
$getWatermark = $watermark->showAll('********-****-****-****-********');  //WatermarkId

// Post
$newWatermark = $watermark->create([
            'title' => 'test',
            'description' => 'dasdas',
            'watermark' => storage_path('1.jpg')

        ], 'channel_id');
        
// PATCH
$updatedWatermark = $watermark->update([
    'title' => 'new Name',
    'description' => 'updated description'
]);

// DELETE (by watermark ID)
$watermark->delete('********-****-****-****-********');  //WatermarkId
  1. Subtitle:
$subtitle = $vodSdk->subtitle();

// GET (get all video subtitles)
$videoSubtitles = $subtitle->showAll('********-****-****-****-********');  //VideoId

// GET (get specific subtitle)
$subtitle = $subtitle->show('********-****-****-****-********');  //SubtitleId

// POST (create a subtitle)
$newSubtitle = $subtitle->create([
            'lang' => 'en',
            'subtitle' => storage_path('test.vtt')
        ], '********-****-****-****-********');  //VideoId
        
// DELETE
$subtitle->delete('********-****-****-****-********');  //SubtitleId
  1. Porfile:
$profile = $vodSdk->profile();

//GET (get all channel profiles)
$allChannelprofiles = $profile->showAll('********-****-****-****-********');  //ChannelID

//GET (get specific profile)
$profile = $profile->show('********-****-****-****-********');  //ProfileID

//POST
$newProfile = $profile->create([
        'title' => 'string',
        'description' => 'string',
        'convert_mode' => 'auto',
        'thumbnail_time' => 0,
        'watermark_id' => 'string',
        'watermark_area' => 'CENTER',
        'convert_info' => [
            [
                'audio_bitrate' => 0,
                'video_bitrate' => 0,
                'resolution' => 'string'
            ]
        ]
    ], '********-****-****-****-********');  //ChannelID
    
//PATCH

$newProfile = $profile->update('8a953ada-30b6-4279-b1ba-217ca108c06a', [
        'title' => 'updated title',
        'description' => 'updated description',
        'convert_mode' => 'manual',
        'thumbnail_time' => 1,
        'convert_info' => [
            [
                'audio_bitrate' => ***,
                'video_bitrate' => ***,
                'resolution' => '****x***'
            ]
        ]
    ]);

// DELETE
$profile->delete('********-****-****-****-********');  //ProfileId

arvan/vod-client-sdk 适用场景与选型建议

arvan/vod-client-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 arvan/vod-client-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 arvan/vod-client-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 arvan/vod-client-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-07-14