Responsible for loading video content into the player.
Allows you to implement streaming protocols that integrate with
different streaming servers, video hosting networks or Content
Written with ActionScript 3.0
Must implement a
class. The Flowplayer library contains a default implementation for
this class and you can extend it to implement your own provider.
Loaded into the player upon configuration or at runtime using the
Flowplayer uses a HTTP streaming provider by default which uses HTTP
progressive download for loading video data. Other implementations
interact with “pseudostreaming” or the RTMP streaming protocol.
Streaming plugin basics
In Flash 9, video streaming is typically done using the
class. Flowplayer has a NetStream implementation called
is the class your streaming provider must implement. By default,
for streaming video data. This provider does HTTP progressive
downloading which is the most common way to stream videos in the
This way you don't need to implement all the methods shown in the
interface below, but rather override and customize just those methods
that you need to achieve your desired custom behavior. Both our
are implemented this way.
If you want to write a provider from scratch, this is the inteface
that your provider must implement:.
The load(clip:Clip) method initiates loading of a video clip. The
provider should connect to the server and request the video in this
method. Once the provider receives data from the server it should
dispatch the event object that was passed to it. Similarly, all
methods that receive an event as a parameter should dispatch the event
object once the corresponding action has been performed.
Example plugin: YouTube provider
It's fairly simple to implement a provider that shows videos from
YouTube. The goal in this example is to show videos from YouTube using
the following configuration:
The tricky part here is that YouTube changes the URLs of their video
files frequently and therefore the URL of the video needs to be
regenerated for each playback. The provider implemented here uses the
approach presented in this from
idea is to use a proxy server that requests a page from the YouTube
site and parses its HTML source to find out the "secret" video
ID. This ID is then used to form a URL that will load the actual FLV
video file from the YouTube servers.
Below is our provider implementation. It uses a proxy server to
generate URLs for the YouTube video files. All streaming logic is
inherited from the NetStreamControllingStreamProvider superclass.
Flash requires the main class of a SWF to be a DisplayObject,
typically a Sprite or a MovieClip. A provider is not a visual
object and therefore we need a way to create and pass the provider to
the player from the plugin SWF's main class. To achieve this our
plugin's main class implements the PluginFactory
To build our plugin use the YouTube class shown above as your FLA's
document class or as the main class when building with the Flex SDK's
Here is a Java implementation for the proxy used to generate the URL
based on the video ID. This needs to be installed on a Web server.
We recommend that you download the source code of the RTMP and
pseudostreaming providers from their own documentation pages. Study
those to learn more!