Jump to content

video streaming lag


mysterbx

Recommended Posts

Hello, i'v recently found a video steeaming script on the web, modified it a bit...

everything works like it should, but when the video is being loaded, my site doesnt work, nothing loads up till the video is being loaded...

 

Here is the code im using:

			ob_end_clean();
		set_time_limit(0);
		$filesize=@filesize($file)-(($position>0)?$position+1:0);
		$filedate=@filemtime($file);
		$fileopen=@fopen($file,"r");
		header("Content-Type: video/x-flv");
		header("Content-Disposition: attachment; filename=\"".$filename."\"");
		header("Content-Length: ".$filesize);
		if($position!=0){
			@fseek($fileopen,$position);
			print("FLV");
			print(pack("C",1));
			print(pack("C",1));
			print(pack("N",9));
			print(pack("N",9));
		}
		while(!(connection_aborted() || connection_status() == 1) && $bytes_sent<$filesize){
			print(fread($fileopen,$limit_download_rate*1042));
			$bytes_sent=($limit_download_rate+$bytes_sent);
			flush();
			ob_flush();
			sleep(1);
		}
		@fclose($fileopen);
		@exit();

what could be the problem with it?

i have been working more than a few hours and i could figure out what is wrong with it.

 

please help me out here

Link to comment
https://forums.phpfreaks.com/topic/192441-video-streaming-lag/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.