<html>
<head>
<title>test</title>
</head>
<body>
<?php
include('embed_video.php');
// Get this class from this page:
// https://www.phpclasses.org/package/4-PHP-Arbitrary-XML-parser-.html
include('filecacheclass.php');
// Get this class from this page:
// https://www.phpclasses.org/package/12086-PHP-Get-details-and-manage-videos-using-YouTube-API-v3.html
include('xml_parser.php');
// Get this class from this page:
// https://www.phpclasses.org/package/313-PHP-Cache-arbitrary-data-in-files-.html
include('youtube_client.php');
$url = 'https://www.youtube.com/watch?v=UZe7hcbNlXY';
$video = new embed_video_class;
$video->width = '560px';
$video->height = '315px';
$video->lazy_load = true;
$video->youtube_key = ''; $application_line = __LINE__;
if($video->youtube_key === '')
{
echo '<h1>You need to set the YouTube API Key in line ', $application_line, '.</h1>', "\n";
echo '<p>', 'Please go to ',
'<a href="https://console.developers.google.com/project">Google Developer API Console</a>,'.
' get a key for the YouTube API'.'
and set it in the line '.$application_line, '</p>';
}
else
{
if($video->GetVideoDetails($url, '', $details))
{
$tags = $video->GetVideo(0, true, $details['title'], $url);
echo '<h1>Details for video: ', $url, '</h1>', "\n";
echo '<pre>';
print_r($details);
echo '</pre>';
echo '<div align="center">'.$tags.'</div>';
echo '<div align="center"><pre style="width: 40em; border-style: solid; border-width: 1px; text-align: left; white-space: pre-wrap; word-wrap: break-word;">'.htmlspecialchars($tags), '</pre></div>';
}
else
echo '<h1>Error: ', HtmlSpecialChars($video->error), '</h1>', "\n";
}
?>
</body>
</html>
|