PHPackages                             sensiolabs-de/live2vod-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sensiolabs-de/live2vod-api

ActiveLibrary[API Development](/categories/api)

sensiolabs-de/live2vod-api
==========================

Live2VOD API related objects

1.87.0(2mo ago)07.9k↓10.4%proprietaryPHPPHP ^8.1.2CI passing

Since Oct 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/sensiolabs-de/live2vod-api)[ Packagist](https://packagist.org/packages/sensiolabs-de/live2vod-api)[ RSS](/packages/sensiolabs-de-live2vod-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (87)Used By (0)

Live2VOD API
============

[](#live2vod-api)

A PHP library for interacting with the ORF Live2VOD system, providing API clients, domain objects, webhook handling, and DRM token generation.

Overview
--------

[](#overview)

This package provides a complete SDK for the ORF Live2VOD system, including:

- HTTP client for session management
- Domain value objects (Clip, Session, Form, Marker, etc.)
- Webhook event handling and factories
- DRM token generation
- Request/Response DTOs for API communication
- Foundry factories for testing

Installation
------------

[](#installation)

This package is intended to be installed via Composer:

```
composer require sensiolabs-de/live2vod-api
```

Usage
-----

[](#usage)

### Session API Client

[](#session-api-client)

```
use SensioLabs\Live2Vod\Api\Client;
use SensioLabs\Live2Vod\Api\SessionApi;
use SensioLabs\Live2Vod\Api\Domain\Api\Request\CreateSessionRequest;
use SensioLabs\Live2Vod\Api\Domain\Identifier\SessionId;
use Symfony\Component\HttpClient\HttpClient;

// Initialize the client
$httpClient = HttpClient::create();
$client = new Client($httpClient, 'https://api.example.com');
$sessionApi = new SessionApi($client);

// Create a session
$request = new CreateSessionRequest(/* ... */);
$response = $sessionApi->create($request);

// Get session details
$session = $sessionApi->get($response->id);

// Delete a session
$sessionApi->delete($response->id);
```

### Domain Objects

[](#domain-objects)

```
use SensioLabs\Live2Vod\Api\Domain\Identifier\ClipId;
use SensioLabs\Live2Vod\Api\Domain\Clip\Status;
use SensioLabs\Live2Vod\Api\Domain\Session\Form\Field\StringField;
use SensioLabs\Live2Vod\Api\Domain\Session\Form\Fields;
use SensioLabs\Live2Vod\Api\Domain\Session\Form\Name;
use SensioLabs\Live2Vod\Api\Domain\Session\Form\Label;

// Create identifiers
$clipId = ClipId::fromString('01HQX...');

// Create form fields
$field = new StringField(
    name: new Name('title'),
    label: new Label('Video Title'),
    required: true,
);

$fields = Fields::fromArray([
    ['type' => 'string', 'name' => 'title', 'label' => 'Title', 'required' => true],
    ['type' => 'textarea', 'name' => 'description', 'label' => 'Description'],
]);
```

### Webhook Handling

[](#webhook-handling)

```
use SensioLabs\Live2Vod\Api\Webhook\WebhookEventFactory;
use SensioLabs\Live2Vod\Api\Domain\Webhook\Event\ClipCompletedEvent;

$factory = new WebhookEventFactory();

// Parse webhook payload
$event = $factory->createFromPayload($webhookPayload);

if ($event instanceof ClipCompletedEvent) {
    // Handle clip completed event
    $clipId = $event->clipId;
    $sessionId = $event->sessionId;
}
```

### DRM Token Generation

[](#drm-token-generation)

```
use SensioLabs\Live2Vod\Api\DRM\TokenGenerator;
use SensioLabs\Live2Vod\Api\Domain\DRM\GeoLocation;

$tokenGenerator = new TokenGenerator('your-secret-key');

$token = $tokenGenerator->generate(
    sessionId: $sessionId,
    clipId: $clipId,
    geoLocation: GeoLocation::AT,
    expiresAt: new \DateTimeImmutable('+1 hour')
);
```

Available Components
--------------------

[](#available-components)

### API Clients

[](#api-clients)

#### `Client` &amp; `ClientInterface`

[](#client--clientinterface)

HTTP client wrapper for making API requests with customizable HTTP client support.

#### `SessionApi` &amp; `SessionApiInterface`

[](#sessionapi--sessionapiinterface)

High-level API for session management:

- `create(CreateSessionRequest)` - Create new session
- `get(SessionId)` - Retrieve session details
- `delete(SessionId)` - Delete session

#### `NullSessionApi`

[](#nullsessionapi)

Null object implementation for testing/development.

### API Request/Response (`Domain\Api`)

[](#api-requestresponse-domainapi)

#### Request Objects

[](#request-objects)

- `CreateSessionRequest` - DTO for session creation

#### Response Objects

[](#response-objects)

- `CreateSessionResponse` - Response after session creation
- `SessionResponse` - Complete session details

### DRM Components

[](#drm-components)

#### `TokenGenerator` &amp; `TokenGeneratorInterface`

[](#tokengenerator--tokengeneratorinterface)

Generate DRM tokens for protected content access.

#### Domain Objects (`Domain\DRM`)

[](#domain-objects-domaindrm)

- `Token` - DRM token value object with expiration
- `GeoLocation` - Geographic location enum for geo-blocking

### Webhook Components

[](#webhook-components)

#### `WebhookEventFactory` &amp; `WebhookEventFactoryInterface`

[](#webhookeventfactory--webhookeventfactoryinterface)

Factory for creating webhook event objects from payloads.

#### Webhook Events (`Domain\Webhook\Event`)

[](#webhook-events-domainwebhookevent)

- `ClipCreatedEvent` - Fired when clip is created
- `ClipCompletedEvent` - Fired when clip processing completes
- `ClipUpdatedEvent` - Fired when clip is updated
- `ClipErrorEvent` - Fired when clip processing fails
- `ClipDeletedEvent` - Fired when clip is deleted
- `ClipsCompletedEvent` - Fired when all session clips complete
- `ClipsFailedEvent` - Fired when session clips fail
- `SessionDeletedEvent` - Fired when session is deleted

#### Webhook Domain Objects (`Domain\Webhook`)

[](#webhook-domain-objects-domainwebhook)

- `Event` - Base webhook event interface
- `Clip` - Clip representation in webhooks
- `Payload\ClipStatusCallbackPayload` - Payload for clip status callbacks
- `Payload\ClipDeletedCallbackPayload` - Payload for clip deletion callbacks

### Factory Components

[](#factory-components)

- `AssetsFactory` - Creates clip assets from API responses
- `CreateSessionRequestFactory` - Creates session requests
- `ConfigFactory` - Creates session configurations
- `TokenFactory` - Creates DRM tokens
- `Webhook\WebhookEventFactory` - Creates webhook events

### Identifiers (`Domain\Identifier`)

[](#identifiers-domainidentifier)

- `ClipId` - ULID-based identifier for clips
- `SessionId` - ULID-based identifier for sessions
- `MarkerId` - ULID-based identifier for markers
- `IdTrait` - Shared trait for identifier value objects

### Clip Domain (`Domain\Clip`)

[](#clip-domain-domainclip)

- `Status` - Enum for clip status (created, recording, completed, failed)
- `StreamType` - Enum for stream types (HLS, DASH, MP4)
- `Assets` - Collection of clip assets (streams and files)
- `Stream` - Stream asset with URL and type
- `File` - File asset with URL, type, and bitrate
- `Bitrate` - Value object for bitrate (e.g., 1080p, 720p)
- `FileType` - Enum for file types (MP4, etc.)
- `Filepath` - Value object for file paths
- `Thumbnail` - Thumbnail URL value object
- `FormData` - Dynamic form data for clips

### Marker Domain (`Domain\Marker`)

[](#marker-domain-domainmarker)

- `Type` - Enum for marker types (chapter, advertisement, intro, blackfade, mute, beitrag)

### Session Domain (`Domain\Session`)

[](#session-domain-domainsession)

- `Config` - Session configuration
- `Channel` - Channel identifier
- `Form` - Dynamic form configuration
- `FormConfig` - Form configuration wrapper

### Form Value Objects (`Domain\Session\Form`)

[](#form-value-objects-domainsessionform)

- `Name`, `Label`, `Placeholder`, `Help`, `Description` - String value objects for form metadata
- `Icon` - Icon identifier for UI elements
- `Endpoint` - URL endpoint for form submission or actions
- `FieldType` - Enum for field types (STRING, TEXTAREA, SELECT, NUMBER, DATE, etc.)
- `ActionOn` - Enum for action triggers (CHANGE, etc.)
- `Field` - Base form field
- `Fields` - Collection of form fields with validation and type-safe access
- `Button` - Form button definition
- `Buttons` - Collection of form buttons
- `Action` - Dynamic field action
- `Actions` - Collection of dynamic field actions

### Field Types (`Domain\Session\Form\Field`)

[](#field-types-domainsessionformfield)

- `StringField` - Text input with validation (minLength, maxLength, pattern)
- `TextareaField` - Multi-line text input
- `NumberField` - Numeric input with min/max validation
- `DateField` - Date input
- `DateTimeField` - DateTime input
- `SelectField` - Single select dropdown
- `MultiSelectField` - Multiple select dropdown
- `BooleanField` - Checkbox/toggle
- `ImageField` - Image upload field
- `UrlField` - URL input with validation

### Common Value Objects (`Domain`)

[](#common-value-objects-domain)

- `Title` - Title value object
- `Url` - URL value object with validation

### Exceptions

[](#exceptions)

- `Exception\InvalidUrlException` - Thrown for invalid URLs
- `Domain\Clip\Exception\FileNotFoundException` - Thrown when file not found
- `Domain\Session\Form\Exception\FieldNotFoundException` - Thrown when accessing non-existent field
- `Domain\Session\Form\Exception\FieldTypeMismatchException` - Thrown when field type doesn't match expected type

### Testing Utilities

[](#testing-utilities)

The package includes Foundry factories for easy test data generation:

- Located in `src/Factory/` namespace
- Integrated with `zenstruck/foundry` for seamless testing
- Use in your tests to create realistic mock data

Development
-----------

[](#development)

### Automatic Sync

[](#automatic-sync)

The Domain objects in this package are automatically synchronized from the main ORF Live2VOD repository using `.github/sync-live2vod-api.sh`.

**Sync Configuration:**

The sync script uses key-value mappings to copy directories:

```
SYNC_MAPPINGS=(
    "src/Domain:live2vod-api/src/Domain"
)
```

To customize sync behavior, edit the mappings in `.github/sync-live2vod-api.sh`. Supports:

- Directory mappings: `"src/Domain:live2vod-api/src/Domain"`
- File mappings with renaming: `"src/Domain/Foo.php:live2vod-api/src/Domain/Bar.php"`

**How it works:**

1. Copies all files from `src/Domain/` recursively
2. Transforms namespaces from `App\Domain` to `SensioLabs\Live2Vod\Api\Domain`
3. Updates all use statements to reference the new namespace
4. Validates PHP 8.1 syntax compatibility with `php -l`
5. Auto-detects and copies missing dependencies
6. Can be run manually: `bash .github/sync-live2vod-api.sh`

**PHP 8.1 Validation:**

The sync script automatically validates all copied files for PHP 8.1 compatibility:

- Runs `php -l` syntax check on every file
- Catches PHP 8.2+ features like readonly classes
- Exits with error if any file fails validation
- Ensures package maintains PHP 8.1.2+ compatibility

### Subtree Split

[](#subtree-split)

This package is automatically split into the [sensiolabs-de/live2vod-api](https://github.com/sensiolabs-de/live2vod-api) repository using GitHub Actions.

**Workflow Configuration:**

The split workflow (`.github/workflows/split-live2vod-api.yaml`) triggers on push to `develop` when `live2vod-api/` files change:

```
on:
    push:
        branches:
            - develop
        paths:
            - 'live2vod-api/**'
```

**Setup Requirements:**

1. Create GitHub Personal Access Token with repository write access
2. Add as repository secret: `LIVE2VOD_API_SPLIT_TOKEN`
3. Workflow uses `symplify/github-action-monorepo-split` to extract subtree
4. Pushes to `sensiolabs-de/live2vod-api` repository on `main` branch

**Manual Split (Alternative):**

If GitHub Actions unavailable, use git subtree:

```
cd orf-live2vod
git subtree split --prefix=live2vod-api -b live2vod-api-split
cd ../live2vod-api
git pull ../orf-live2vod live2vod-api-split
git push origin main
```

Or use `splitsh-lite` for better performance:

```
splitsh-lite --prefix=live2vod-api/ --origin=develop --target=refs/heads/main
git push git@github.com:sensiolabs-de/live2vod-api.git refs/heads/main
```

Requirements
------------

[](#requirements)

- PHP 8.1.2 or higher
- oskarstark/enum-helper ^1.8
- oskarstark/trimmed-non-empty-string ^1.9
- symfony/http-kernel ^6.4 || ^7.0
- symfony/uid ^6.4 || ^7.0
- thecodingmachine/safe ^3.0
- webmozart/assert ^1.11
- zenstruck/foundry ^2.7.5

License
-------

[](#license)

Proprietary

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Recently: every ~10 days

Total

86

Last Release

62d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b0aaaa249bfef22b586e459b3fd8687e58644fb6223ffe8e4e709ac05be704d?d=identicon)[OskarStark](/maintainers/OskarStark)

---

Top Contributors

[![sensiolabs-bot](https://avatars.githubusercontent.com/u/168757867?v=4)](https://github.com/sensiolabs-bot "sensiolabs-bot (86 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (2 commits)")

### Embed Badge

![Health badge](/badges/sensiolabs-de-live2vod-api/health.svg)

```
[![Health](https://phpackages.com/badges/sensiolabs-de-live2vod-api/health.svg)](https://phpackages.com/packages/sensiolabs-de-live2vod-api)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[storyblok/php-content-api-client

PHP Client for Storyblok Content API

11136.8k4](/packages/storyblok-php-content-api-client)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
