PHPackages                             riccardo993/mainstreamingtv - 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. riccardo993/mainstreamingtv

ActiveLibrary[API Development](/categories/api)

riccardo993/mainstreamingtv
===========================

PHP SDK for mainstreaming.tv APIs

v1.0.0(8y ago)09PHPPHP ^7.0

Since Jan 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/riccardo993/mainstreamingtv)[ Packagist](https://packagist.org/packages/riccardo993/mainstreamingtv)[ RSS](/packages/riccardo993-mainstreamingtv/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

mainstreamingtv
===============

[](#mainstreamingtv)

PHP SDK for mainstreaming.tv APIs

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

[](#installation)

Install the package via composer: `composer require riccardo993/mainstreamingtv`

You need PHP 7 or upper to use this package.

Usage
-----

[](#usage)

In order to use this package you need an API token from the provider and your IP address added in their whitelist.

Upload a file
-------------

[](#upload-a-file)

In order to perform the file upload process you need to generate a single-use url to which your data is sent.

```
$output = [
    'error' => null,
    'data' => null
];

try{
    $provider = new Mainstreaming('API_TOKEN');
    $path = $provider->upload()->getSecureUploadPath();

    $output['data'] = [
        'url' => $path
    ];
}catch(\Exception $e){
    $output['error'] = $e->getMessage();
    http_response_code(500);
}

header('Content-Type: application/json; charset=utf-8');
echo json_encode($output);
```

Since the API does not provide a return option, you should not use it directly in your form action field but instead in an ajax request. Once the upload is done, the server response with the video id and store it in the `contentId` variable.

Since the single-use url only lasts for few minutes, you should generate it only when the user is going to upload the file.

With the jQuery File Upload library you can do this in this way:

```
$('#fileupload').fileupload({
    submit: function(e, data) {
        var $that = $(this);

        $.post('/video/generate-action', function(result) {
            data.url = result.data.url; // Set the url
            $that.fileupload('send', data); // Manually perform the sending request
        }).fail(function(result) {
            alert(result.responseJSON.error); // The single-use url could not be created
        });

        return false;
    }
}).bind('fileuploaddone', function (e, data) {
    var id = data.result.contentId; // get your unique video ID
});
```

**We are not going to use chunked upload because it is not working**

### Custom attributes during the upload

[](#custom-attributes-during-the-upload)

You can put lots of field in your form to set file attributes. The commons are the upload directory and the filename.

To get the category ID use the dedicated method.

```

```

Video status
------------

[](#video-status)

You can check if your video is ready to be seen or on queue or encoding.

```
$status = $provider->video('VIDEO_ID')->getStatus();
```

You get one of these errors:

- queued
- encoding
- ready
- error

If you perform the video status query immediately after the upload, you could get an error because the API does not find your video yet so make sure to perform a check before:

```
if($video = $provider->video('VIDEO_ID'))
{
  $status = $video->getStatus();
}
```

Get the upload directory ID
---------------------------

[](#get-the-upload-directory-id)

Supposed you have a folder named `My Videos` you can automatically get the ID simply with one command:

```
$id = $provider->categories()->find('my videos')->getId();
```

If you are not sure that your folder exists you should check it before accessing its method like this:

```
if($category = $provider->categories()->find('my videos'))
{
  $id = $category->getId();
}
```

**Note that the research is case insensitive**

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

3084d ago

### Community

Maintainers

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

---

Top Contributors

[![riccardo993](https://avatars.githubusercontent.com/u/10183990?v=4)](https://github.com/riccardo993 "riccardo993 (5 commits)")

---

Tags

phpmainstreamingmainstreamingtv

### Embed Badge

![Health badge](/badges/riccardo993-mainstreamingtv/health.svg)

```
[![Health](https://phpackages.com/badges/riccardo993-mainstreamingtv/health.svg)](https://phpackages.com/packages/riccardo993-mainstreamingtv)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

596.2M36](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M11](/packages/checkout-checkout-sdk-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[clicksend/clicksend-php

301.6M11](/packages/clicksend-clicksend-php)

PHPackages © 2026

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