starttime); $end_time = toTimestamp($rrec->endtime ); $duration = $end_time - $start_time; $size = 3 * 1024 * 1024 * $duration; // 1秒あたり3MBと仮定 header('Content-type: video/mpeg'); header('Content-Disposition: inline; filename="'.$rrec->path.'"'); header('Content-Length: ' . $size ); ob_clean(); flush(); $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" ); if( $fp !== false ) { do { $start = microtime(true); if( feof( $fp ) ) break; echo fread( $fp, 6292 ); @usleep( 2000 - (int)((microtime(true) - $start) * 1000 * 1000)); } while( connection_aborted() == 0 ); } fclose($fp); } catch(exception $e ) { exit( $e->getMessage() ); } ?>