Mercurial > epgrec.yaz
annotate sendstream.php @ 39:8965ef108821
change: modify all scripts for web base setting.
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 11:50:04 +0900 |
parents | f5a9f0eb4858 |
children | f40b6cc4c587 |
rev | line source |
---|---|
1 | 1 <?php |
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"); | |
7 | |
8 | |
9 include_once("config.php"); | |
10 include_once(INSTALL_PATH . "/DBRecord.class.php" ); | |
11 include_once(INSTALL_PATH . "/reclib.php" ); | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
12 include_once(INSTALL_PATH . "/Settings.class.php" ); |
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
13 |
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
14 $settings = Settings::factory(); |
1 | 15 |
16 if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php"); | |
17 $reserve_id = $_GET['reserve_id']; | |
18 | |
19 | |
20 try{ | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
21 $rrec = new DBRecord( RESERVE_TBL, "id", $reserve_id ); |
1 | 22 |
23 $start_time = toTimestamp($rrec->starttime); | |
24 $end_time = toTimestamp($rrec->endtime ); | |
25 $duration = $end_time - $start_time; | |
26 | |
27 $size = 3 * 1024 * 1024 * $duration; // 1秒あたり3MBと仮定 | |
28 | |
29 header('Content-type: video/mpeg'); | |
30 header('Content-Disposition: inline; filename="'.$rrec->path.'"'); | |
31 header('Content-Length: ' . $size ); | |
32 | |
33 ob_clean(); | |
34 flush(); | |
35 | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
36 $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" ); |
1 | 37 if( $fp !== false ) { |
38 ob_start(null,4096); | |
39 $status = array(); | |
40 do { | |
41 echo fread( $fp, 4096 ); | |
42 if( feof( $fp ) ) break; | |
43 | |
44 $status = ob_get_status(); | |
45 } | |
46 while( $status['status'] != PHP_OUTPUT_HANDLER_END ); | |
47 } | |
48 fclose($fp); | |
49 } | |
50 catch(exception $e ) { | |
51 exit( $e->getMessage() ); | |
52 } | |
53 ?> |