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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.