The JWPlatform PHP library provides convenient access to the JW Platform Management API from applications written in the PHP language.
Visit JW Player Developer site for more information about JW Platform API.
PHP 5.6.0 and later.
You can install the bindings via Composer. Run the following command:
composer require jwplayer/jwplatform
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
If you do not wish to use Composer, you can download the
latest release.
Then, to use the bindings, include the init.php
file.
require_once('/path/to/jwplatform-php/init.php');
The bindings require the following extensions in order to work properly:
curl
, although you can use your own non-cURL client if you prefer
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
Please refer to our documentation for all API functionality.
$jwplatform_api = new Jwplayer\JwplatformClient('INSERT API SECRET');
$media_id = 'INSERT MEDIA ID';
$site_id = 'INSERT SITE ID';
$response = $jwplatform_api->Media->get($site_id, $media_id);
The V1 Client remains available for use but is deprecated. We strongly recommend using the V2 Client when possible.
$jwplatform_api = new Jwplayer\v1\JwplatformAPI('INSERT API KEY', 'INSERT API SECRET');
Get Composer. For example, on Mac OS:
brew install composer
Install dependencies:
composer install
JW Platform API library is distributed under the MIT license.