定制 pbmengine/pbm-video-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pbmengine/pbm-video-sdk

Composer 安装命令:

composer require pbmengine/pbm-video-sdk

包简介

This package is a PHP Rest Client SDK for PBM Video API

README 文档

README

Latest Version on Packagist Total Downloads

The PHP SDK provides a convenient way to use the PBM video api.

Installation

You can install the package via composer:

composer require pbmengine/pbm-video-sdk

Usage

Prerequisites

You need an Api Key to use this package!

Create a project

You must create a project to use the api. Actually you'll need only 1 project pr application. So store the project_id somewhere in your config files.

$project = video()->createProject(<project name>, <identifier optional>, <description optional);
// your project id
$project->data()->id
// your project access key
$project->data()->access_key
// your project secret key
$project->data()->secret_key
// store these values in config/pbm-video.php

Create a template

A template is a blueprint for each dynamic movie! So if you have several videos in your application, you'll need several templates.

// the data to create a template must contain
// please see api documentation for more properties
// movie name and movie project id must be known from isw
$data = [
    'name' => 'super duper video',
    'movie_name' => 'the well known movie name',
    'movie_project_id' => 'the well known movie project id',
    'protection' => true|false // if protected the video is not publicly accessible
];

$template = video()->createTemplate(<your project id>, array $data);

Check needed params for video

$movie = video()->iswProject(<movie project id>);
// response is something like this
// important here is the variables -> collection field -> name
[
  "data" => array:4 [
    "id" => "12e2045f-6257-48c7-bdaa-3a975bf74598"
    "created_at" => "2019-11-21T12:42:01+00:00"
    "name" => "video_test_api"
    "dynamic_movies" => array:1 [
      0 => array:9 [
        "seconds" => 10
        "variable_length" => false
        "width" => 1920
        "height" => 1080
        "codec" => "H264/AAC"
        "created_at" => "2019-11-21T12:51:03+00:00"
        "updated_at" => "2020-02-04T16:08:15+00:00"
        "name" => "intro_clip"
        "variables" => array:1 [
          "collection" => array:3 [
            0 => array:4 [
              "num_frames" => 250
              "default_value" => "hintergrund.jpg"
              "name" => "hintergrund"
              "type" => "image"
            ]
            1 => array:4 [
              "num_frames" => 250
              "default_value" => "Mustervorname"
              "name" => "vorname"
              "type" => "text"
            ]
            2 => array:4 [
              "num_frames" => 250
              "default_value" => "Musternachname"
              "name" => "nachname"
              "type" => "text"
            ]
          ]
        ]
      ]
    ]
  ]
]

Create video

// you will need the above mentioned params

// data should be
$data = [
    'params' => [
        'key1' => 'value',
        'key2' => 'value',
        'key3' => 'value',
    ]
];
$video = video()->createVideo(<projectId>, <templateId>, <name>, <data>)

Status of Video

$status = video()->videoStatus(<video id>, <project id>);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email systems@personal-business-machine.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固