<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<form method="get">
<label>video link (youtube.com, vimeo.com, rutube.ru, dailymotion.com):</label>
<input type="text" name="link">
<input type="submit">
</form>
<?php
if (!empty($_GET)){
include_once 'c_video_providers.php';
$link=trim($_GET['link']);
if (!empty($link)){
$o_video_providers=new c_video_providers();
$video_code=$o_video_providers->get_video_code($link);
if ($video_code===false){
echo "video provider isn't support<br>";
}
else {
$video_info=$o_video_providers->get_video_info($video_code);
echo "video code: $video_code<br>";
echo "link: <a href='".$video_info['url_watch']."'>".$video_info['url_watch']."</a><br>";
echo "preview small: <img src='".$video_info['url_img_preview']['small']."'><br>";
echo "preview medium: <img src='".$video_info['url_img_preview']['medium']."'><br>";
echo "preview large: <img src='".$video_info['url_img_preview']['large']."'><br>";
echo "video: ".$video_info['embed']."<br>";
}
}
}
?>
</html>
|