Play FLV and Live Video with Flash Lite 3.0
Play FLV and Live Video with Flash Lite 3.0

I have made a few test with Flash Lite 3.0 and Flash Media Server 3 and I have to say that it is pretty easy to stream FLV Video files and Live Video from local web camera to mobile phone. Here are a quick instructions how to do it in Windows (I will publish Linux version later).

Play FLV-video from Flash Media Server 3:

* Install Flash Media Server 3 (download developer version)
* There are a few sample FLV files in applications/vod/media folder, so you can use one of them for testing
* Create a new Flash Lite 3.0 file in Flash
* Add a new Video symbol to library
* Drag this Video symbol to Stage and give instance name to it: video
* Type following programming to timeline:

Code:

// make a new video-object
var video:Video;
// make a new NetConnection-object
var nc:NetConnection = new NetConnection();

// check connection status from server
nc.onStatus = function(info:Object):Void {
status_txt.text=info.code;
if (info.code == “NetConnection.Connect.Success”) {
startStreaming();
}
}

// start streaming video to phone
function startStreaming() {
ns = new NetStream(nc);
ns.setBufferTime(5);
video.attachVideo(ns);
// play sample.flv from server
ns.play(”sample”,0);
}

// show info to user
status_txt.text = “Connecting server…”;

// connect FMS 3 video on demand service (default port 1935)
nc.connect(”rtmp://your.server.ip.here:1935/vod”);

* Go to Publish Settings…
* Set Local playback security: Access network only
* Publish your SWF-file
* Send your SWF-file to your phone
* Test and you should see FLV-video playing in your phone

Play live video from Flash Media Server 3:

* Install Flash Media Server 3 (download developer version)
* Install Flash Media Encoder 2 (Windows only)
* Start Flash Media Encoder 2
* You should see your live camera in Input screen
* Press Start-button to start sending live video to Flash Media Server 3
* Create a new Flash Lite 3.0 file in Flash
* Add Video symbol and programming as you did earlier
* Modify your programming:

Code:

// in startStreaming()-function
// Flash Media Encoder 2 publish stream name is “livestream”
ns.play(”livestream”,-1,-1,true);

// start connection to Flash Media Server 3
// Flash Media Encoder 2 publishes Flash Media Server’s default
// live publishing point, so connect it
nc.connect(”rtmp://your.server.ip.here:1935/live”);

* Publish, test and enjoy

Download :

fl300_5B1_5D.jpg (15 KB)
VideosToPhone.zip (12 KB)
flashlite3_developeredition.zip (607 KB)

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Live
  • Ma.gnolia
  • MyShare
  • Reddit
  • Socialogs
  • SphereIt
  • Spurl
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Related posts :
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...