<?php

/**
*
* @package Free Tube Script
* @version v1.0
* @copyright (c) 2011 Agriz
* @license GNU Public License Under Certain Conditions [Powered by should remain unchanged]
* @contact http://www.agrizlive.com
*
*/

class ImageHelper extends AppHelper {
    function makeThumbnail($source, $video_id, $image_url) {
	
		switch($source) {
			case "youtube":
				$image_url = "http://img.youtube.com/vi/$video_id/1.jpg";
				break;
			case "metacafe":
				$image_url = "http://www.metacafe.com/thumb/".$video_id.".jpg";
				break;
			case "other":
				break;
		}
        return $image_url;
    }
	
	function makeEmbed($source,$video_id,$embed_code,$width,$height) {
		switch($source) {
			case "youtube":
				$embed_code = '<iframe width="'.$width.'" height="'.$height.'" src="http://www.youtube.com/embed/'.$video_id.'" frameborder="0" allowfullscreen></iframe>';
				break;
			case "metacafe":
				$embed_code = '<embed flashVars="playerVars=showStats=yes|autoPlay=no|videoTitle=" src="http://www.metacafe.com/fplayer/'.$video_id.'/the_trip_movie_trailer.swf" width="'.$width.'" height="'.$height.'" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_'.$video_id.'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
				break;
			case "other":
				break;
		}
        return $embed_code;
	}
	
}

?>
