All pastes #108683 Raw Edit

Untitled

public text v1 · immutable
#108683 ·published 2006-07-31 16:54 UTC
rendered paste body
<?php
	if($_REQUEST['Submit']){
		$format = $_REQUEST['format'];
		$size = $_REQUEST['size'];
		if($remember){
			setcookie('format', $format);
			setcookie('size', $size);
		}			
	} else {
		if($_COOKIE['format']){
			$format = $_COOKIE['format'];
		}
		if($_COOKIE['size']){
			$size = $_COOKIE['size'];
		}
	}
	
	$video = $_REQUEST['video'];
	
	$size_array['mov']['large'] = array(480,360);
	$size_array['mov']['medium'] = array(320,240);
	$size_array['mov']['small'] = array(160,120);
/*	$size_array['wmv']['large'] = array(480,434);
	$size_array['wmv']['medium'] = array(320,240);
	$size_array['wmv']['small'] = array(160,120); */
	$w = $size_array[$format][$size][0];
	$h = $size_array[$format][$size][1];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Crescent Rim</title>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="video">
<?php if(!$size || !$format || $change_settings){ ?>
<br>
<h1 style="margin-top:-3px;">Video Settings
    </h1>
    <form name="form1" method="get" action="">
<!--    <p><strong>Select a format:</strong></p>
    <p>
          <label>
    <input name="format" type="radio" value="mov"<?php if($_COOKIE['format'] == "mov"){ print " checked"; }?>>
    Quicktime</label>
          <br>
          <label>
          <input type="radio" name="format" value="wmv"<?php if($_COOKIE['format'] == "wmv"){ print " checked"; }?>>
    Windows Media</label>
        </p> -->
   <input name="format" type="hidden" value="mov" >
    <p><strong>Select a resolution:</strong></p>
    <p>
        <label>
  <input name="size" type="radio" value="large"<?php if($_COOKIE['size'] == "large"){ print " checked"; }?>>
  Large</label>
        <br>
        <label>
        <input type="radio" name="size" value="medium"<?php if($_COOKIE['size'] == "medium"){ print " checked"; }?>>
  Medium</label>
        <br>
        <label>
        <input type="radio" name="size" value="small"<?php if($_COOKIE['size'] == "small"){ print " checked"; }?>>
  Small</label>
</p>
<!--    <p>
      <input name="remember" type="checkbox" id="remember" value="true" checked>
      Remember settings 
    </p> -->
    <p>
      <input type="submit" name="Submit" value="Play Video">
	  <input type="hidden" name="video" value="<?=$video?>">
	  <input type="hidden" name="display_title" value="<?=$display_title?>">
    </p>
    </form>
	<?php } else if($video){ ?>
    <h1 style="margin-top:-3px;"><?=$display_title?>
    </h1><?php
		$video_file = $video."_".$size.".".$format;
		//if($format == "mov"){
			$h += 20;
			?>
			<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"  width="<?=$w?>" height="<?=$h?>" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
			<param name="src" value="media/<?=$video_file?>">
			<param name="controller" value="true">
			<param name="pluginspage" value="http://www.apple.com/quicktime/download/">
			<embed width="<?=$w?>" height="<?=$h?>" controller="true" src="media/<?=$video_file?>" bgcolor="FFFFFF" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>		
			</object>
	  <?php
		/*} else if($format == "wmv"){
			$h += 72; ?>
			<object width="<?=$w?>" height="<?=$h?>" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1">
			<param name="Filename" value="http://www.snakeriver2020.com/video/<?=$video_file?>">
			<param name="AutoStart" value="True">
			<param name="ShowControls" value="True">
			<param name="ShowStatusBar" value="True">
			<param name="ShowDisplay" value="False">
			<param name="AutoRewind" value="True">
			<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="<?=$w?>" height="<?=$h?>" src="http://www.snakeriver2020.com/video/<?=$video_file?>" filename="http://www.snakeriver2020.com/video/<?=$video_file?>" autostart="True" showcontrols="True" showstatusbar="True" showdisplay="False" autorewind="True"></embed> 
			</object>
		<?php
		} */ ?>
		<br>
		<a href="./video.php?change_settings=true&video=<?=$video?>&display_title=<?=$display_title?>">Change Player Settings &gt;</a>
		
<?php		
	} ?>
	</div>
</body>
</html>