Apache2-EmbedFLV

 view release on metacpan or  search on metacpan

lib/Apache2/EmbedFLV/Template.pm  view on Meta::CPAN

	my($self, %opts) = @_;
	my $opts = \%opts;

	if($opts->{template} and -r $opts->{template}) {
		open my $fh, "<", $opts->{template} or die $!;
		$default_template = "";
		while(<$fh>) {
			$default_template .= $_;
		}
		close $fh;
	}

	my $flowplayer = "/flowplayer.swf";
	$flowplayer = $opts->{flowplayer} if $opts->{flowplayer};

  my $js = do {local $/;<DATA>};

	my $url = $opts->{uri}."?".$opts->{md5};
	$video =~ s/%%% url %%%/$url/;
	$video =~ s/%%% js %%%/$js/;
	$video =~ s/%%% flowplayer %%%/$flowplayer/;

	my $tt = Template->new;
	my $output;

	$tt->process(\$default_template, {
		video => $video,
	}, \$output);
	
	return $output;

}

1;

__DATA__

/** 
 * flowplayer.js 3.0.3. The Flowplayer API
 * 
 * Copyright 2008 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Version: 3.0.3 - Wed Jan 07 2009 13:22:30 GMT-0000 (GMT+00:00)
 */
(function(){function log(args){console.log("$f.fireEvent",[].slice.call(args));}function clone(obj){if(!obj||typeof obj!='object'){return obj;}var temp=new obj.constructor();for(var key in obj){if(obj.hasOwnProperty(key)){temp[key]=clone(obj[key]);}}...
self=this,api=null,html,commonClip,playlist=[],plugins={},listeners={},playerId,apiId,playerIndex,activeIndex,swfHeight,wrapperHeight;extend(self,{id:function(){return playerId;},isLoaded:function(){return(api!==null);},getParent:function(){return wr...



( run in 1.243 second using v1.01-cache-2.11-cpan-39bf76dae61 )