Flash Video files can be stream & delivered in several different ways on the web. Main delivery options are.
- As a standalone .FLV file.
- Embedded in SWF file using Flash Authoring Tool.
- Progressive Download via HTTP.
- Streaming via RTMP to the Flash Player using Flash Media Server.
Standalone .FLV File:
It is the normal way to deliver Flash video using a Flash player to control. The .FLV file itself is only playable with an FLV player.
Embedded in SWF File:
In this approach, the entire file must be transferred before playback can begin. Changing the video requires rebuilding the SWF file.
Streaming via RTMP to the Flash Player using Flash Media Server.
Streamed via RTMP to the Flash Player using the Flash Media Server
(formerly called Flash Communication Server).
Progressive Download via Http:
This method uses ActionScript to include an externally hosted Flash Video file for playback. Progressive download has serveral advantages, including buffering, use of generic HTTP servers and the ability to reuse a single SWF player for multiple Flash Video sources.
In this way you can access video files using the partial download functionality of HTTP, sometime referred to as streaming.
However, unlike streaming using RTMP, HTTP "streaming" does not support real-time broadcasting.
Streaming via HTTP requires a custom player and the injection of specific Flash video metadata containing the exact starting position in bytes and timecode of easy keyframe. Using this specific information, a custom Flash Video player can request any part of the Flash Video file starting at a specified keyframe.
e.g our demo kit,
Video Starter Kit Advance Edition support pseudo-streaming & progressive downloading and can seek to any part of the video before buffering is complete.
The server side part of this "
HTTP pseudo-streaming" method is fairly simple to implement. Here we add information about how to use or generate server script in ASP.NET to achieve Flash video pseudo-streaming or progressive download capability.
We generate pseudo-streaming script for ASP.NET that can help you to implement Flash video HTTP progressive download & pseudo streaming in ASP.NET
Live demo of ASP.NET pseudo-streaming script is on
http://www.remix-video.com/video/374/legion-trailer.aspx
You can download streaming script from
http://www.mediasoftpro.com/downloads/stream.zip
Configuring ASP.NET HTTP streaming Script:
1: Configuring Flash video directory path
private string _vsk_path_files = "/contents/member/";
The above code will set directory root path where Flash video store and will stream.
2: Configure list of allowed domains for streaming.
private static string[] _allowed_domains = new string[] { "www.remix-video.com", "www.mediasoftpro.com"};
Put list of domains that you want only to be allowed for streaming or accessing Flash video files.
3: Configure list of restricted domains for accessing Flash content.
private static string[] _restricted_domains = new string[] { "www.sampledomain.com", "www.sampledomain2.com", "www.sampledomain3.com" };
Using ASP.NET HTTP streaming Script in Flash Player:
First you need to make sure that whether Flash Player that you are using support HTTP Streaming.
The below example uses JW Player for accessing ASP.NET HTTP streaming script, read configuration and stream video based on configuration.
s1.addVariable("streamer","http://www.example.com/vsk/stream/streamer.ashx");
s1.addVariable("token","UserID");
The above two lines configure HTTP streaming for JW Player. Token can be any value and is used for validation purpose.
In demo kit
Video Starter Kit Advance Edition we used token for sending unique user id to script that helps to generate path for user video files for streaming.
Your feedback is appreciated to improve ASP.NET script more for HTTP streaming.