2 header("Expires: Thu, 01 Dec 1994 16:00:00 GMT");
3 header("Last-Modified: ". gmdate("D, d M Y H:i:s"). " GMT");
4 header("Cache-Control: no-cache, must-revalidate");
5 header("Cache-Control: post-check=0, pre-check=0", false);
6 header("Pragma: no-cache");
9 include_once("config.php");
10 include_once(INSTALL_PATH . "/DBRecord.class.php" );
11 include_once(INSTALL_PATH . "/reclib.php" );
12 include_once(INSTALL_PATH . "/Settings.class.php" );
14 $settings = Settings::factory();
16 if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php");
17 $reserve_id = $_GET['reserve_id'];
21 $rrec = new DBRecord( RESERVE_TBL, "id", $reserve_id );
23 $start_time = toTimestamp($rrec->starttime);
24 $end_time = toTimestamp($rrec->endtime );
25 $duration = $end_time - $start_time;
27 $size = 3 * 1024 * 1024 * $duration; // 1秒あたり3MBと仮定
29 header('Content-type: video/mpeg');
30 header('Content-Disposition: inline; filename="'.$rrec->path.'"');
31 header('Content-Length: ' . $size );
36 $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" );
39 $start = microtime(true);
40 if( feof( $fp ) ) break;
41 echo fread( $fp, 6292 );
42 @usleep( 2000 - (int)((microtime(true) - $start) * 1000 * 1000));
44 while( connection_aborted() == 0 );
48 catch(exception $e ) {
49 exit( $e->getMessage() );