#!/usr/bin/perl -- # Make an smil document with and embedded movie # Version 0.8 # George Cook 09/22/2004 # # This cgi accepts a url to a movie and creates a smil file. require 5; use strict; use CGI; $CGI::DISABLE_UPLOADS = 1; #disable any attempt to upload file via this cgi $CGI::POST_MAX = 512; #set the maximum input for post to 512 bytes my ($url, $fullscreen, $width, $height, $window_name, $author, $copyright, $starttime, $endtime); ($url, $fullscreen, $width, $height, $window_name, $author, $copyright, $starttime, $endtime) = split /,/,$ENV{'QUERY_STRING'}; # these parameters set the parameters of the smil document my $width_default=352; my $height_default=264; my $window_name_default="SMIL Video"; my $author_default="George Cook"; my $copyright_default="demo.edu"; # set default values for parameters if ($width eq "") { $width = $width_default; } if ($height eq "") { $height = $height_default; } if ($window_name eq "") { $window_name = $window_name_default; } if ($author eq "") { $author = $author_default; } if ($copyright eq "") { $copyright = $copyright_default; } if ($url eq "") { # Return an error print "Content-type: text/plain\n\n"; print "A url must be specified"; exit; } else { print "Content-type: application/smil\n\n"; print < XMLHEAD if (length($starttime) > 0 and length($endtime) > 0) { # return the link for mov, mp4 or sdp files print < EMBED } else { print < EMBED } exit; }