Easily build beautiful video experiences into your PHP app.
We publish Mux PHP to Packagist. You should depend on Mux PHP by adding us to your composer.json file.
{
"require": {
"muxinc/mux-php": ">=0.0.1"
}
}
Then install your dependencies.
composer install
And then autoload in your code.
require_once 'vendor/autoload.php';
To start, you'll need a Mux access token. Once you've got that, you're off to the races!
// Authentication Setup
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername(getenv('MUX_TOKEN_ID'))
->setPassword(getenv('MUX_TOKEN_SECRET'));
// API Client Initialization
$assetsApi = new MuxPhp\Api\AssetsApi(
new GuzzleHttp\Client(),
$config
);
// Create Asset Request
$input = new MuxPhp\Models\InputSettings(["url" => "https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4"]);
$createAssetRequest = new MuxPhp\Models\CreateAssetRequest(["input" => $input, "playback_policy" => [MuxPhp\Models\PlaybackPolicy::PUBLIC_PLAYBACK_POLICY] ]);
// Ingest
$result = $assetsApi->createAsset($createAssetRequest);
// Print URL
print "Playback URL: https://stream.mux.com/" . $result->getData()->getPlaybackIds()[0]->getId() . ".m3u8\n"
Getting started is fast and easy with direct uploads - this means no intermediate storage for you to manage.
Mux integrates with all major web and mobile video players.
Automatically deliver the best user experience for every combination of device, browser, location, bandwidth, etc.
Also includes helpers for Mux Data if you want to include performance metrics into your own dashboard client.
Ingest using almost any codec, including H.264, H.265, VP9, and Apple ProRes. Get multi-bitrate adaptive streaming with HLS delivery.
Adapt to new devices and codecs with no extra work. We'll automatically update codecs and renditions of the life of a video.
Use signed playback policies by easily creating signed URL tokens for your Mux assets when you want to control access to a piece of content.
We love issues, pull requests, forks, and compliments (constructive criticism counts too).
Mux is made up of an advanced transcoding engine, streaming origin, and expertly configured CDNs which all work together to provide the best video experience for your users with the least amount of headache for you.
Get the fastest video publishing possible. Videos are encoded while the first viewers watch them so your users can publish instantly.
Not only is Mux fast, but we make sure that your video will look its best across every screen, on every network.
Mux is made up of an advanced transcoding engine, streaming origin, and expertly configured CDNs which all work together to provide the best video experience for your users with the least amount of headache for you.
Learn moreHandle thousands of concurrent live streamers and millions of viewers without worrying about spinning up additional servers.
RTMP for ingest and HLS for delivery so your application can stream from a mobile app, broadcast software, or hardware encoder and broadcast to any device.
Transition seamlessly from live to VoD with recordings available immediately after the event with no waiting for additional processing.
No credit card required to start using Mux.