Mercurial > epgrec.yaz
annotate sendstream.php @ 120:cb04c9ca1cb0
add: チャンネルスキップの追加途中(改造中)
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Sun, 14 Mar 2010 23:49:11 +0900 |
parents | 01079b81f125 |
children |
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 do { | |
59
f40b6cc4c587
change: viewer & stream
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
39
diff
changeset
|
39 $start = microtime(true); |
1 | 40 if( feof( $fp ) ) break; |
59
f40b6cc4c587
change: viewer & stream
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
39
diff
changeset
|
41 echo fread( $fp, 6292 ); |
60
01079b81f125
modified: sendstream.php
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
59
diff
changeset
|
42 @usleep( 2000 - (int)((microtime(true) - $start) * 1000 * 1000)); |
1 | 43 } |
60
01079b81f125
modified: sendstream.php
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
59
diff
changeset
|
44 while( connection_aborted() == 0 ); |
1 | 45 } |
46 fclose($fp); | |
47 } | |
48 catch(exception $e ) { | |
49 exit( $e->getMessage() ); | |
50 } | |
60
01079b81f125
modified: sendstream.php
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
59
diff
changeset
|
51 ?> |