PHP code example of pierreminiggio / heropost-and-youtube-api-based-video-poster
1. Go to this page and download the library: Download pierreminiggio/heropost-and-youtube-api-based-video-poster 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/ */
pierreminiggio / heropost-and-youtube-api-based-video-poster example snippets
use PierreMiniggio\GoogleTokenRefresher\GoogleClient;
use PierreMiniggio\HeropostAndYoutubeAPIBasedVideoPoster\Video;
use PierreMiniggio\HeropostAndYoutubeAPIBasedVideoPoster\VideoPosterFactory;
use PierreMiniggio\HeropostYoutubePosting\YoutubeCategoriesEnum;
use PierreMiniggio\HeropostYoutubePosting\YoutubeVideo;
use Psr\Log\LoggerInterface;
xt = [])
{
$this->log('critical', $message, $context);
}
public function error($message, array $context = [])
{
$this->log('error', $message, $context);
}
public function warning($message, array $context = [])
{
$this->log('warning', $message, $context);
}
public function notice($message, array $context = [])
{
$this->log('notice', $message, $context);
}
public function info($message, array $context = [])
{
$this->log('info', $message, $context);
}
public function debug($message, array $context = [])
{
$this->log('debug', $message, $context);
}
public function log($level, $message, array $context = [])
{
var_dump($level, $message, $context);
}
}
$poster = (new VideoPosterFactory())->make(new TestLogger());
$poster->post(
'login',
'password',
'youtubeChannelId',
new Video(
new YoutubeVideo(
'title',
'description',
YoutubeCategoriesEnum::EDUCATION
),
['tag1', 'tag2', 'tag3'],
false,
'video.mp4',
'thumbnail.png'
),
new GoogleClient(
'clientId',
'clientSecret',
'refreshToken'
)
);