Create and update videos & profiles...
Install with composer:
composer require corbpie/gumlet-api
Use like:
require __DIR__ . '/vendor/autoload.php';
use Corbpie\Gumlet;
$gm = new Gumlet\GumletVideo();
Line 7 GumletBase.php
const API_KEY = 'XXXX-XXXX-XXXX';
$gm->listProfiles();
Requires $gm->profile_id to be set
$gm->profile_id = 'TJQuvxBnOcxQwnPOWc';
Requires $gm->profile_id to be set
$gm->getProfile();
$parameters = [
'description' => 'The description for this new profile',
'mp4_access' => true
];
$format = 'HLS';//HLS, MPEG-DASH, MP4
$gm->createProfile('the-new-profile-name', $format, $parameters);
Requires $gm->video_collection to be set
$gm->listVideos();
$gm->video_id = '65f1819d759d13a91c0a4c09';
echo json_encode($gm->getVideo());
Requires $url and $gm->video_collection
$gm->createVideoFromUrl($url, $format, $parameters);
Inputs:
Note setting $gm->profile_id will override everything except the $url and the collection id
string
$url
The URL to download the video from to use.
string
$format
Format for the video encoding "HLS, MPEG-DASH and MP4" ONLY!
array
$parameters
Optional values for the video creation:
[
'tag'=> 'example, another',
'title'=> 'title to video',
'description'=> 'This video is all about XYZ',
'width'=> '75%',
'height'=> '75%',
'resolution'=> '720p',
'mp4_access'=> true,
'per_title_encoding'=> false,
'process_low_resolution_input'=> true,
'audio_only'=> false,
'enable_drm'=> true
]
$parameters = [
'profile_id' => '65138fa952ccfd817db2a665',
'title' => 'The title for this great video',
'description' => 'The description for this great video',
'mp4_access' => false,
'audio_only' => false,
'additional_tracks' => [
[
'url' => 'https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac',
'type' => 'audio',
'language_code' => 'en',
'name' => 'English'],
[
'url' => 'https://gumlet.sgp1.digitaloceanspaces.com/video/sample_1.aac',
'type' => 'audio',
'language_code' => 'pl',
'name' => 'Polish'
]
]
];
$video = $gm->createVideoFromUrl(
'https://domain.com/video.mp4',
'MP4',
$parameters
);
$gm->video_id = '65f1819d759d13a91c0a4c09';
$frame = 20;
$gm->updateVideoThumbnailFromFrame($frame);
$gm->video_id = '65f1819d759d13a91c0a4c09';
$gm->updateVideoTitle('The new title for this video');
$gm->video_id = '65f1819d759d13a91c0a4c09';
$gm->updateVideoDescription('The new description for this video');
$gm->video_id = '65f1819d759d13a91c0a4c09';
$gm->deleteVideo();