Jump to content

Live Video Stream


Ninjakreborn

Recommended Posts

OK here is the issue. I am trying to setup some Amazon S3 usage. I have it going really well currently (I mean I can do anything with photo's) but I am having trouble getting raw code for videos to stream.  I am basically doing this...

<?php
function test($filename = 'niceday.wmv') {
	$filename = basename($filename);
	$file_extension = strtolower(substr(strrchr($filename,"."),1));

	switch($file_extension) {
		case "mp3": $ctype="audio/mpeg"; break;
		case "wav": $ctype="audio/x-wav"; break;
		case "mpeg":
		case "mpg":
		case "mpe": $ctype="video/mpeg"; break;
		case "mov": $ctype="video/quicktime"; break;
		case "avi": $ctype="video/x-msvideo"; break;	
		case "wmv": $ctype="video/wmv"; break;
	}		
	//Use the switch-generated Content-Type
	header("Content-Type: $ctype");	

	echo $this->s3_get_file('niceday.wmv', 'theendlesstribute_tributevideos');
}
?>

This is in codeignitor. Right now this tries to stream me a text file with the raw video source code. I am trying this on a WMV file. I am basically needing this function to get a video

from S3 and then using the code generate a file internally that can be called..say I have a video player...I want to have it setup and call this test function and have it work properly...

does that make any sense?

 

What is the best way to go about doing this?

Link to comment
https://forums.phpfreaks.com/topic/205863-live-video-stream/
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.