PHP code example of corbpie / gumlet-api

1. Go to this page and download the library: Download corbpie/gumlet-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corbpie / gumlet-api example snippets




use Corbpie\Gumlet;

$gm = new Gumlet\GumletVideo();


const API_KEY = 'XXXX-XXXX-XXXX';

 $gm->listProfiles();

$gm->profile_id = 'TJQuvxBnOcxQwnPOWc';

 $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);

 $gm->listVideos();

 $gm->video_id = '65f1819d759d13a91c0a4c09';

 echo json_encode($gm->getVideo());


 $gm->createVideoFromUrl($url, $format, $parameters);

$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();
GumletBase.php