two-faces/ivideon-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

two-faces/ivideon-php

最新稳定版本:v1.0.1

Composer 安装命令:

composer require two-faces/ivideon-php

包简介

IVideon

关键字:

README 文档

README

compatible

This is PHP Library which allow work with IVideon API

Instalation

composer require two-faces/ivideon-php
$account = new Account('login_email', 'password', '.cache');
$api = new Api($account, new WebFlow());

Please use .cache file.

In first run library will try to login with your email and password and store your access_token, userid and userApiUrl in cache file all next runs will use these data.

If cacheFile not set api will try login in every run (slowly)

Print all server and cameras

$servers = $api->servers->getServers();

foreach ($servers as $server) {
    echo $server->getTimezone(); // Important! see below
    foreach ($server->getCameras() as $camera) {
        echo $camera->getId() . PHP_EOL;
    }
}

Create export request

/* Create export request
 * Please note that $start, $end is unix timestamp values
 * Please verify that $start, $end in your server timezone
 * 
 * Important! 
 * IVideon not allow to export "empty" videos, when nobody in all period
 * ExportRequestFailedException will be thrown
 */
$exportResult = $api->camera->exportMp4($cameraId, $start, $end);
$exportId = $exportResult->getId();

Get all exports

$exports = $api->camera->getExports();
foreach ($exports as $export) {
    echo $export->getId() . ' = ' . $export->getStatus();

    if ($export->getStatus() == \IVideon\Responses\ExportResult::EXPORT_STATUS_READY) {
        echo ' = ' . $export->getVideoUrl();
    }
    echo PHP_EOL;
};

Delete export file

$api->camera->deleteExport($exportId); // bool

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2024-02-20