PHP code example of aidens / youtube

1. Go to this page and download the library: Download aidens/youtube 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/ */

    

aidens / youtube example snippets


'providers' => [
    ...
    aiden\Youtube\YoutubeAPIServiceProvider::class,
],

'aliases' => [
    ...
    'YoutubeAPI'=>aiden\Youtube\Facades\YoutubeAPI::class,
],

$video = YoutubeAPI::upload($fullPathToVideo, [
    'title'       => 'My Awesome Video',
    'description' => 'You can also specify your video description here.',
    'tags'	      => ['foo', 'bar', 'baz'],
    'category_id' => 10
]);

return $video->getVideoId();

$video = YoutubeAPI::upload($fullPathToVideo, $params, 'unlisted');

$fullpathToImage = storage_path('app/public/thumbnail.jpg');

$video = YoutubeAPI::upload($fullPathToVideo, $params)->withThumbnail($fullpathToImage);

return $youtube->getThumbnailUrl();

YoutubeAPI::delete($videoId);

YoutubeAPI::createPlaylist($playlistName,$descriptions,$privacy);

YoutubeAPI::getAllPlayList();

YoutubeAPI::playListInfoById($playlistId);

YoutubeAPI::playListItemById($playlistId);

YoutubeAPI::insertVideoInPlaylist($videoId,$playlistId);

YoutubeAPI::removeVideoFromPlaylist($videoPlaylistId);

YoutubeAPI::updatePlaylist($id,$title,$description);

YoutubeAPI::deletePlaylist($id);

YoutubeAPI::uploadDrive($path, $data = array('name' => 'foo', 'mimeType' => 'bar'));

YoutubeAPI::deleteDrive($fileId);

php artisan vendor:publish --provider="aiden\Youtube\YoutubeAPIServiceProvider"