Posts Tagged ‘flash’

flowplayer.org and red5

Tuesday, June 16th, 2009

Dozens of posts on the net reference using red5 with flowplayer for rtmp streaming, but, none give you precisely the code required.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
	
<script src="flowplayer-3.1.1.min.js">	

<style>
a.rtmp {
	display:block;
	width:640px;
	height:360px;	
	margin:25px 0;
	text-align:center;
}

a.rtmp img {
	border:0px;
	margin-top:140px;
}
</style>

<a class="rtmp" href="#">
<img src="http://static.flowplayer.org/img/player/btn/showme.png"  />
</a>

<script type="text/javascript">

$f("a.rtmp", "flowplayer-3.1.1.swf", { 
		
	clip: { 
		provider: 'rtmp',
// name of the .flv from /webapps/oflaDemo/streams without the .flv
                url: 'IronMan' 
	}, 
	
	plugins: {  
	  rtmp: {  
		url: '/fprt/flowplayer.rtmp-3.1.0.swf',			
		netConnectionUrl: 'rtmp://hostname/oflaDemo'
	  } 
	}     
});
</script>

Make sure you have the following files:

* flowplayer-3.1.1.swf
* flowplayer.controls-3.1.1.swf
* flowplayer.rtmp-3.1.0.swf

If you receive the error:

300: Player Initialization Failed: TypeError: Error #1009

Then you are missing flowplayer.controls-3.1.1.swf from your directory.

In the javascript,

netConnectionUrl: ‘rtmp://hostname/oflaDemo’

needs to be set the hostname of your red5 server.

url: ‘IronMan’

needs to be set to the name of the .flv in the webapps/oflaDemo/streams directory without the .flv extension

/usr/lib/red5/webapps/oflaDemo/streams# ls -1 *.flv
DarkKnight.flv
IronMan.flv
on2_flash8_w_audio.flv
test.flv

Entries (RSS) and Comments (RSS).
Cluster host: li