Release Candidate
login to your account

Streaming plugin RTMP Streaming from Flash media servers using the RTMP protocol

Introduction

RTMP stands for "Real Time Messaging Protocol". It is a proprietary protocol developed by Adobe Systems for streaming audio, video and data over the Internet, between a Flash player and a server. Following RTMP servers are the most popular servers and they are all supported by this streaming plugin:

(Version 3.0.0-beta2)

Features

This protocol offers following features

Example

This example uses the RTMP streaming plugin to stream a video from Adobe Flash Media Server 3. Try seeking into any part of the timeline.

<!-- setup player normally -->
<a class="player" id="fms">	
	<img src="../../img/player/btn/showme.png"  />
</a>
$f("fms", "../../swf/flowplayer-3.0.0-rc3.swf", {

	// configure clip to use "rtmp" plugin for providing video data
	clip: { 
		url: 'metacafe', 
		provider: 'rtmp' 
	},
	
	// streaming plugins are configured under the plugins node 
	plugins: {
	
		// here is our rtpm plugin configuration
		rtmp: { 
			url: 'flowplayer.rtmp-3.0.0-beta2.swf', 
			
			// netConnectionUrl defines where the streams are found
			netConnectionUrl: 'rtmp://cyzy7r959.rtmphost.com/flowplayer' 
		}
	}	
});

You should consult your servers documentation how streaming servers are setup and what are their specialities. For example:

Adobe's Flash Media Server does not like the file extension in the clip's URL so you should not include in the value - just use for example url: 'metacafe' even when the file is actually named 'metacafe.flv'.

Combining streams

Our next example combines two video files into one stream. We alternate between two videos playing 10 seconds each time before switching to the other video. Every time we switch back to a video it resumes from the same time it was previously stopped at. There are no gaps when the stream switches, it comes as one continuous bitstream from the server. Flowplayer's controlbar shows the two streams in one timline corresponding to their total duration.

<!-- our player container named "streams" -->
<a class="player" id="streams">	
	<img src="../../img/player/btn/showme.png"  />
</a>
$f("streams", "../../swf/flowplayer-3.0.0-rc3.swf", {
	clip: {
		
		// use rtmp provider
		provider: 'rtmp',
		
		// combined streams are configured into "streams" node as follows
		streams: [
			{ url: 'metacafe', duration: 10 },
			{ url: 'honda_accord', start: 2, duration: 10 },
			{ url: 'metacafe', start: 10, duration: 10 },
			{ url: 'honda_accord', start: 10, duration: 10 },
			{ url: 'metacafe', start: 20, duration: 10 },
			{ url: 'honda_accord', start: 20, duration: 10 },
			{ url: 'metacafe', start: 30, duration: 10 },
			{ url: 'honda_accord', start: 30, duration: 10 }
		]
	},
	
	// our rtmp plugin is configured identically as in first example
	plugins: {
		rtmp: {
			url: 'flowplayer.rtmp-3.0.0-beta2.swf', 
			netConnectionUrl: 'rtmp://cyzy7r959.rtmphost.com/flowplayer',
		}
	}
});

Multiple servers

You can have clips in the playlist coming from several RTMP servers.

$f("container3", "../../swf/flowplayer-3.0.0-rc3.swf", {

	// common configuration for each clip
	clip: { 
	
		// each clip uses rtmp provider
		provider: 'rtmp' 
	},
	
	// here is our playlist
	playlist: [
		'mp4:video1.mp4',
		'mp4:video2.mp4',
		
		{
			// third clip uses different RTMP server 
			netConnectionUrl: 'rtmp://red5hosting.com/vodapp',
			url:'Extremists.flv'
		}
	],
	
	plugins: {
		rtmp: { 
			url: 'flowplayer.rtmp-3.0.0-beta2.swf', 
			netConnectionUrl: 'rtmp://flowplayer.org:1935/fastplay' 
		}
	}
});

If the netConnectionUrl is given in the clip it overrides the value given in the plugin. In the example above, the first two clips come from the server listening at rtmp://beta.flowplayer.org:1935/fastplay, and the third clip comes from the clip specific server listening at rtmp://red5hosting.com/vodapp.

Download

Get latest version of Flowplayer RTMP streaming plugin. It is compatible with all 3.0+ releases.

flowplayer.rtmp-3.0.0-beta2.swf 1.7 Kb just the working Flash file to get you going
flowplayer.rtmp-3.0.0-beta2.zip 3.0 Kb working Flash file (swf) + README.txt and LICENCE.txt
flowplayer.rtmp-3.0.0-beta2-src.zip 5.7 Kb source code

Please right click and choose "save link as ..." (or similar)

See version history for this tool.

Found a bug?

If you encounter problems in this script please drop a bug report to beta testing forum. If you have a problematic page a direct URL to that page is by far the most effective way of finding bugs.