PHPackages                             tourze/aliyun-vod-bundle - 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. tourze/aliyun-vod-bundle

ActiveSymfony-bundle[API Development](/categories/api)

tourze/aliyun-vod-bundle
========================

阿里云VOD视频点播服务集成Bundle

0.1.0(6mo ago)02351MITPHPCI passing

Since May 29Pushed 6mo agoCompare

[ Source](https://github.com/tourze/aliyun-vod-bundle)[ Packagist](https://packagist.org/packages/tourze/aliyun-vod-bundle)[ RSS](/packages/tourze-aliyun-vod-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (38)Versions (3)Used By (1)

AliyunVodBundle
===============

[](#aliyunvodbundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Build Status](https://camo.githubusercontent.com/68d17a11e1a42f04d9abebdae4f57ee882e64fecdcea349491479c4fd4e72b0f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f75727a652f616c6979756e2d766f642d62756e646c652f706870756e69742e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/tourze/aliyun-vod-bundle/actions)[![Latest Version](https://camo.githubusercontent.com/65fcd7825cdbb740fa86ebd8425bc452bd2a0fa6ba2049d377ea50da619e6a87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f616c6979756e2d766f642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/aliyun-vod-bundle)[![Quality Score](https://camo.githubusercontent.com/9c3beca324ca13823745e5b88f5477ea9088389deb90b165a65b613725276497/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f75727a652f616c6979756e2d766f642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tourze/aliyun-vod-bundle)[![Total Downloads](https://camo.githubusercontent.com/c191ac94b96d79136db11f9be99970a0505af1f85636dae348578139fb3e4be5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f616c6979756e2d766f642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/aliyun-vod-bundle)[![License](https://camo.githubusercontent.com/d4686cb0e7e41bbe83afe33274c8075a926d1c88133d5728690478e310b50201/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f616c6979756e2d766f642d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/aliyun-vod-bundle)[![Code Coverage](https://camo.githubusercontent.com/12367cafb8b4302537b314bfc1c7bfd06f0e126ece3e73686bb6b7b6525a50f1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f616c6979756e2d766f642d62756e646c653f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/aliyun-vod-bundle)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Console Commands](#console-commands)
- [Usage Examples](#usage-examples)
- [Advanced Usage](#advanced-usage)
- [Admin Interface](#admin-interface)
- [API Endpoints](#api-endpoints)
- [Security](#security)
- [Requirements](#requirements)
- [License](#license)
- [Contributing](#contributing)
- [Support](#support)

A Symfony bundle for integrating with Alibaba Cloud Video on Demand (VOD) services. This bundle provides comprehensive video management features including upload, transcoding, playback, and statistics.

Features
--------

[](#features)

- **Video Management**: Upload, update, and manage videos in Alibaba Cloud VOD
- **Transcoding**: Handle video transcoding tasks and monitor progress
- **Playback Statistics**: Track video playback data and generate reports
- **Admin Interface**: EasyAdmin integration for video management
- **Console Commands**: Powerful CLI tools for video operations

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

[](#installation)

```
composer require tourze/aliyun-vod-bundle
```

Configuration
-------------

[](#configuration)

Add the bundle to your `config/bundles.php`:

```
return [
    // ...
    Tourze\AliyunVodBundle\AliyunVodBundle::class => ['all' => true],
];
```

Configure your Alibaba Cloud credentials in your environment variables or configuration files.

Console Commands
----------------

[](#console-commands)

### Video Data Synchronization

[](#video-data-synchronization)

#### `aliyun-vod:sync:from-remote`

[](#aliyun-vodsyncfrom-remote)

Synchronize video data from Alibaba Cloud VOD to local database.

```
# Sync all videos from all configurations
bin/console aliyun-vod:sync:from-remote

# Sync from specific configuration
bin/console aliyun-vod:sync:from-remote --config=default

# Limit sync quantity
bin/console aliyun-vod:sync:from-remote --limit=50

# Force update existing videos
bin/console aliyun-vod:sync:from-remote --force

# Dry run (preview only)
bin/console aliyun-vod:sync:from-remote --dry-run
```

#### `aliyun-vod:sync:to-remote`

[](#aliyun-vodsyncto-remote)

Synchronize local video data to Alibaba Cloud VOD.

```
# Sync all videos
bin/console aliyun-vod:sync:to-remote

# Sync specific video
bin/console aliyun-vod:sync:to-remote --video-id=VIDEO_ID

# Sync videos with specific status
bin/console aliyun-vod:sync:to-remote --status=Normal

# Limit sync quantity
bin/console aliyun-vod:sync:to-remote --limit=50

# Dry run (preview only)
bin/console aliyun-vod:sync:to-remote --dry-run
```

### Transcoding Management

[](#transcoding-management)

#### `aliyun-vod:sync:transcode-task`

[](#aliyun-vodsynctranscode-task)

Synchronize transcoding task status and progress.

```
# Sync all processing tasks
bin/console aliyun-vod:sync:transcode-task

# Sync specific task
bin/console aliyun-vod:sync:transcode-task --task-id=TASK_ID

# Sync tasks with specific status
bin/console aliyun-vod:sync:transcode-task --status=Processing

# Limit sync quantity
bin/console aliyun-vod:sync:transcode-task --limit=50

# Dry run (preview only)
bin/console aliyun-vod:sync:transcode-task --dry-run
```

### Statistics and Reports

[](#statistics-and-reports)

#### `aliyun-vod:statistics:generate`

[](#aliyun-vodstatisticsgenerate)

Generate playback statistics reports.

```
# Generate daily report for yesterday
bin/console aliyun-vod:statistics:generate

# Generate report for specific date
bin/console aliyun-vod:statistics:generate --date=2024-01-01

# Generate weekly report
bin/console aliyun-vod:statistics:generate --type=weekly

# Generate monthly report
bin/console aliyun-vod:statistics:generate --type=monthly

# Output to JSON format
bin/console aliyun-vod:statistics:generate --output=json

# Save to file
bin/console aliyun-vod:statistics:generate --output=json --file=/path/to/report.json

# Output to CSV format
bin/console aliyun-vod:statistics:generate --output=csv --file=/path/to/report.csv
```

### Data Cleanup

[](#data-cleanup)

#### `aliyun-vod:cleanup:play-records`

[](#aliyun-vodcleanupplay-records)

Clean up expired playback records.

```
# Clean records older than 90 days (default)
bin/console aliyun-vod:cleanup:play-records

# Clean records older than 30 days
bin/console aliyun-vod:cleanup:play-records --days=30

# Force cleanup without confirmation
bin/console aliyun-vod:cleanup:play-records --force

# Dry run (preview only)
bin/console aliyun-vod:cleanup:play-records --dry-run
```

Usage Examples
--------------

[](#usage-examples)

### Basic Video Upload

[](#basic-video-upload)

```
use Tourze\AliyunVodBundle\Service\VideoUploadService;

class VideoController
{
    public function __construct(
        private VideoUploadService $videoUploadService
    ) {}

    public function upload(Request $request)
    {
        $uploadedFile = $request->files->get('video');
        $config = $this->getVodConfig(); // Get your VOD configuration

        $result = $this->videoUploadService->uploadVideo(
            $uploadedFile,
            $config,
            'My Video Title',
            'Video description'
        );

        return $this->json($result);
    }
}
```

### Get Video Play Auth

[](#get-video-play-auth)

```
use Tourze\AliyunVodBundle\Service\PlayAuthService;

class VideoController
{
    public function __construct(
        private PlayAuthService $playAuthService
    ) {}

    public function getPlayAuth(string $videoId)
    {
        $config = $this->getVodConfig();
        $playAuth = $this->playAuthService->getPlayAuth($videoId, $config);

        return $this->json(['playAuth' => $playAuth]);
    }
}
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom Video Processing

[](#custom-video-processing)

```
use Tourze\AliyunVodBundle\Service\VideoManageService;
use Tourze\AliyunVodBundle\Service\TranscodeService;

class AdvancedVideoController
{
    public function __construct(
        private VideoManageService $videoManageService,
        private TranscodeService $transcodeService
    ) {}

    public function processVideo(string $videoId)
    {
        $config = $this->getVodConfig();

        // Update video metadata
        $this->videoManageService->updateVideoInfo(
            $videoId,
            $config,
            'Updated Title',
            'Updated Description',
            ['tag1', 'tag2']
        );

        // Start transcoding with custom template
        $transcodeTask = $this->transcodeService->submitTranscodeJobs(
            $videoId,
            $config,
            'template_group_id'
        );

        return $this->json($transcodeTask);
    }
}
```

### Video Statistics and Analytics

[](#video-statistics-and-analytics)

```
use Tourze\AliyunVodBundle\Service\StatisticsService;

class AnalyticsController
{
    public function __construct(
        private StatisticsService $statisticsService
    ) {}

    public function getVideoAnalytics(string $videoId)
    {
        $video = $this->getVideo($videoId);

        // Get comprehensive video statistics
        $stats = $this->statisticsService->getVideoPlayStats($video);

        // Get completion rate
        $completionRate = $this->statisticsService->getVideoCompletionRate($video);

        // Get user behavior analysis
        $userBehavior = $this->statisticsService->getUserPlayBehavior($ipAddress);

        return $this->json([
            'stats' => $stats,
            'completion_rate' => $completionRate,
            'user_behavior' => $userBehavior
        ]);
    }
}
```

### Batch Operations

[](#batch-operations)

```
use Tourze\AliyunVodBundle\Repository\VideoRepository;

class BatchVideoController
{
    public function __construct(
        private VideoRepository $videoRepository,
        private VideoManageService $videoManageService
    ) {}

    public function batchUpdateStatus(array $videoIds, string $status)
    {
        $config = $this->getVodConfig();
        $results = [];

        foreach ($videoIds as $videoId) {
            try {
                $result = $this->videoManageService->updateVideoStatus(
                    $videoId,
                    $config,
                    $status
                );
                $results[] = ['video_id' => $videoId, 'success' => true];
            } catch (\Exception $e) {
                $results[] = [
                    'video_id' => $videoId,
                    'success' => false,
                    'error' => $e->getMessage()
                ];
            }
        }

        return $this->json($results);
    }
}
```

Admin Interface
---------------

[](#admin-interface)

The bundle includes EasyAdmin CRUD controllers for managing:

- **Videos**: Video library management
- **Transcoding Tasks**: Monitor transcoding progress
- **Playback Records**: View playback statistics
- **VOD Configurations**: Manage Alibaba Cloud credentials

API Endpoints
-------------

[](#api-endpoints)

### Video Upload

[](#video-upload)

- `POST /admin/video-upload` - Upload video interface
- `POST /admin/video-upload/auth` - Get upload authorization
- `GET /admin/video-upload/progress` - Check upload progress

### Statistics

[](#statistics)

- `GET /admin/statistics` - Statistics dashboard
- `GET /admin/statistics/popular` - Popular videos
- `GET /admin/statistics/range` - Date range statistics
- `GET /admin/statistics/video-detail/{id}` - Video detail statistics

Security
--------

[](#security)

### Credential Management

[](#credential-management)

**Never commit credentials to your repository.** Use environment variables or secure configuration management:

```
# config/packages/aliyun_vod.yaml
parameters:
    env(ALIYUN_ACCESS_KEY_ID): ~
    env(ALIYUN_ACCESS_KEY_SECRET): ~
    env(ALIYUN_REGION_ID): 'cn-shanghai'
```

### Access Control

[](#access-control)

Implement proper access control for video operations:

```
use Symfony\Component\Security\Http\Attribute\IsGranted;

class VideoController
{
    #[IsGranted('ROLE_VIDEO_ADMIN')]
    public function manageVideos() { /* ... */ }

    #[IsGranted('ROLE_VIDEO_UPLOAD')]
    public function uploadVideo() { /* ... */ }

    #[IsGranted('ROLE_STATISTICS_VIEW')]
    public function viewStatistics() { /* ... */ }
}
```

### Data Protection

[](#data-protection)

- **Video Privacy**: Ensure appropriate access controls for video content
- **User Data**: Follow GDPR/privacy regulations when storing playback data
- **API Security**: Use HTTPS for all API communications
- **Input Validation**: Validate all user inputs, especially file uploads

### Best Practices

[](#best-practices)

1. **Rotate Access Keys**: Regularly rotate your Alibaba Cloud access keys
2. **Limit Permissions**: Use IAM policies to limit VOD service permissions
3. **Monitor Access**: Enable logging and monitoring for video operations
4. **Secure Storage**: Encrypt sensitive configuration data at rest
5. **Rate Limiting**: Implement rate limiting for API endpoints

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

[](#requirements)

- PHP 8.1 or higher
- Symfony 7.3 or higher
- Doctrine ORM
- Alibaba Cloud VOD SDK

License
-------

[](#license)

This bundle is released under the MIT license.

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit pull requests or create issues for any improvements.

Support
-------

[](#support)

For support and questions, please create an issue in the repository.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance67

Regular maintenance activity

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~203 days

Total

2

Last Release

197d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-aliyun-vod-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-aliyun-vod-bundle/health.svg)](https://phpackages.com/packages/tourze-aliyun-vod-bundle)
```

###  Alternatives

[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.4M203](/packages/sulu-sulu)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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