So I set out to see what was possible, in particular I wanted to make sure that Remote SharedObjects (RSOs) and NetConnection methods were available in Flash Lite. Here's what I found.
|
|
|
|
home
|
I've had very little experience with Flash Lite to date, but right now I'm working on a project which requires a mobile element to it. Not satisfied with doing the sensible thing and playing it safe I thought it would be great to offer some real-time features on a mobile, either via AFCS or FMS.
So I set out to see what was possible, in particular I wanted to make sure that Remote SharedObjects (RSOs) and NetConnection methods were available in Flash Lite. Here's what I found.
I recently had a requirement for Scribblar (more on that site in another post) to verify if a domain name or page URL entered by a user is valid. Luckily ActionScript 3 features support for Regular Expressions, however my RegExp skills are non existent. So I reached out via Twitter to see if anyone could help. It took all of 10 minutes and a quick session on pastebin for Robert 'Da Man' Hall to sort the problem out for me. In order to preserve this nugget of knowledge for future generations, here it is.
var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i; Usage var url:String = "http://www.google.com"; var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i; trace(regex.test(url)); // returns true if valid url is found Thanks Robert!
It's a bit embarrassing to admit that it has taken me this long to post this app. I first spoke about it at my talk at MAX 2008 in Milan but then Christmas came and went and I got swamped with work... Apologies, but better late than never. So what have we got here? My PureMVC Skeleton App is a simple Flex project that uses the PureMVC framework to give you a bit of a head start with your next FMS project. I'm by no means suggesting that this is the best way to build an FMS app but what I can say is that it works well for me. Not only that but since I've picked up PureMVC I have been able to build much larger projects than ever before, and the framework allows me to come back to an app months later and pick it up in no time at all. Everything has its place and it's easy to find your way around, and projects generally end up well maintained. In order to connect to your own FMS application you first need to create it on FMS (mine is called pmvcskeleton) and then go into the ResourceBundleProxy and on line 42 add your corresponding RTMP string. I'm not sure if this is a good idea but I often use ResourceBundles for configuration options such as the RTMP string, I find it quite handy since they usually do not change so I just compile that in. It helps if you are a bit familiar with FMS based applications and the MVC design pattern. For everything else check out the PureMVC website, it has tons of info and a lively community. Or why not sign up to my FlashMedia List, there's always a bunch of knowledgeable people there ready to help. On this note I will leave you to it, take a look at the app and feel free to post a comment if anything isn't clear. Massive thanks to Simon who gave me some excellent tips when I got stuck with certain PureMVC nags. Download the project .zip here.
Here's a Connect presentation that some of you may find useful. Kevin Towes presents on the history, concepts and development tasks of building a media player in Flash.
I think his presentation is particularly useful to less technical people who would like to understand a bit more about the Flash development process, and also get a feel for the challenges in building a video player - it turns out it's not as easy as some may think. And since this is what I have been doing a few times over it makes me look really clever.
My friend Simon has just released a neat little Flex application that allows you to test and troubleshoot a simple RemoteObject connection between Flex and CF. It's mainly aimed at people who are new to Flex (or CF) but it will undoubtedly also come in handy for more experienced developers. In fact I think this would also make a great little AIR application.
Sources are provided and you can find all the necessary information here.
I've spent a few hours over the last week or two on porting Christophe Coenraets' Map Rooms application to FMS, Wowza (and Red5 I think _ I haven't tested that one). Map Rooms is a Flex application that uses the Google Maps API for Flash in order to provide collaboration features as well as a text chat. You can test drive the application for yourself here.
Just a quick heads up. There will be some more live webcasting throughout the day today, and we'll also be utilizing the chat a great deal. This was a well received feature yesterday and actually brought tears to my eyes with laughter at times.
The chat is projected up front on the stage and constantly used as a talkback channel to the speakers on stage - a great concept in my opinion. b.TWEEN is turning out to be a great event. It's my first time in Manchester and which is a great city and a brilliant place for a venue. We're at the Museum of Science and Industry, so there's some cool old school tech to be seen, too. I'll head down to the powerhouse later and check out the steam engines...
I've just arrived at b.TWEEN08 in Manchester.
The official line about the event is as follows: b.TWEEN is a unique cross media gathering where interactive ideas are seeded, shared and sold.
Forget spinning cubes with video stuck on their sides and instead check out the demo below. From Immersive Media, same the guys that brought you street view on Google Maps, comes an innovative new way to navigate 360 degrees inside a live playing video. How is it delivered? Flash of course.
Check out this demo. Once the main content starts to play you can click inside the video and drag your mouse into the direction you want to view. Make sure you check out the snowboarders at about 1 minute in - and follow them as they go over the kicker.
There are more demos here.
I spent a couple of hours today on getting my good old Scratchpad application to run on Facebook - a rather pointless exercise I know, especially since I hardly use Facebook at all. Still, please do me a favor and add the app to your profile so it gets some eyeballs - I need at least 5 users before I can submit it to the application directory. Thanks!
Or maybe I should say pseudo-stream... but hey, at least the headline got you to read the post :-)
I'm sure that by now you all know about this popular PHP approach to serving FLV videos progressively, but with the added benefit of being able to seek to any part of the video more or less immediately - something that traditional progressive delivery is not capable of. The PHP approach (which in the meantime has been ported to many other server side languages such as ASP and ColdFusion) is targeted squarely at FLV delivery, a format which may lose a bit of its popularity over the coming months as H.264 support for Flash video becomes more widely available. But fear not, because the clever guys from code-shop have alread been busy developing a H.264 pseudo streaming plugin for Lighty, a very light weight and performant webserver. The plugin allows Lighty to serve up H.264 encoded video content in an almost identical way to the 'old school' PHP method. The implementation as a webserver plugin is also much more efficient than the script based approach (which itself is not bad at all). You can check out a demo here.
I've recently started working with Cliff Hall's PureMVC ActionScript framework (an alternative to Cairngorm or ARP for example) and after investing in a day's training and some sit-down-and-read-the-docs time I really started to like it. I believe it fills a gap in the market for coders like myself who know their way around AS, Flash and Flex but who struggle sometimes with implementing a good architecture. And that's where frameworks such as PureMVC come in - they force you into a best practices approach and to me that's exactly what I needed. You end up with an application that is much tighter, better structured and scalable, yet easy to maintain.
PureMVC is a bit of a new kid on the block when it comes to MVC frameworks so it's great to see that it stacks up well against the alternatives, so well in fact that it came out on top during a shootout at the Silicon Valley Flex Users Group (SilvaFUG). PureMVC is my chosen framework for the time being and I am using for all my current projects.
The most popular post by far on my site is the one covering pseudo video streams via PHP. In a nutshell, this method allows you to provide a streaming-like experience to your users without having to deploy a streaming server. This offers the benefits of a low cost architecture using only a webserver which runs PHP or one of the ports that users have posted in the comments, including .NET, ColdFusion and others.
Lorenzo Benjamin of xmoov.com has taken the PHP approach to the next level and added a bunch of nice features to it. He's also providing a productized offering around it which add some real value to anyone who's looking for a turn key solution. He's also followed my example and open sourced his PHP code. Nice job Lorenzo. I've seen other 'companies' take the code I posted and use it for commerical purposes without as much as an attribution, let alone posting their modified sources.
Another video on Adobe Media Player is making the rounds. You can check it out here. Deeje Cooley from Adobe not only demos the player but also talks about the branding features, RSS integration amongst other features. Well worth checking out.
Adobe's upcoming Player certainly appears as the new (and better) iTunes for web video.
More footage on the Adobe Media Player - Craig Barberich demos a preview of the upcoming player at Streaming Media East with a little preview of some of its interactive features. I'm not sure how stuff such as the clickable jacket will be possible without some serious manual intervention or setup but nevertheless this is once again showing us were it's all heading. Way to go Adobe!
If you are using Flash Media Encoder to stream the live video portion of your application but you also need to accpt 'normal' user connections in the same app then this code snippet may be helpful to you.
This code checks the Client.agent property of a connecting client in serverside ActionScript (typically in your main.asc file) and determines if FME 1.0 connects. You can base the rest of your connection logic around that. Likewise if it's a normal user connecting you may run other logic. Take for example a Peoplelist: you wouldn't want FME to show up in there as an undefined user would you? application.onConnect = function(newClient) This will trace either 'FME connects: true' or 'FME connects: false'. { trace( "FME connects: " +(newClient.agent.indexOf("FME/1.0") == 0) ); } Maybe this will help someone.
Here's one I made earlier.
This simple Player uses the new FLV Captioning Component in Flash CS3 (note: Flash CS3 is currently available as part of some of the new CS3 Suites. The standalone product will follow). It's a simple demo but you got to admit that it's pretty neat - consider also that the captions are read from an external file. No sources this time (sorry) as this is part of a commercial project I'm working on. However it will be easy to recreate once you got Flash CS3.
I meant to post this since a couple of weeks... On my little round trip through the blogosphere I spotted this gem on Steve Wolkoff's blog: a pair of Flash apps that will help you get up and running with Flash Media Server.
The applications include one live streaming publish/subscribe piece and one streaming video playback application, including all sources. You can download both from this Adobe Connect room. Probs to Scott Morgan (FMS Support Engineer) who created these apps for us.
I'm currently working on a video chat app using Flash Media Server and Flex. This will be version 2 of my Ameegos.com excercise and this time I want to add real scalability to the app. It already supports multiple rooms (which users can create) and is based around a concept of one master application instance holding a persistent SharedObject containing all the room information which each room fetches as it starts up.
A very popular UK dating/adult site (URL on request ;-) has bought the code from me and is running a modified version of Ameegos on their site and the chat is proving popular to put it mildly. So popular in fact that a single server couldn't cope with the traffic and was frequently being brought to its knees by around 1500 concurrent video chatters.
Huddle is a new web conferencing service which facilitates users to deliver rich media trainings, presentations, or events in real time and on demand. With Huddle you can schedule and hold a global virtual meeting with dozens, even hundreds of people in a fraction of the time and cost it would take to meet face-to-face.
HUDDLE is now giving away 100 free accounts - all you need to do is sign up and hope that you are amongst the first 100 users to do so. To find out more about HUDDLE you can check out their website's FAQ and Whatis sections. HUDDLE is a product of Eli Kirk with fellow developer Jake Hilton as the driving force. You can be sure that this is a solid product and service (after all it runs on Flash Media Server - and Linux I presume ;)). Feel free to leave feedback here once you have tried HUDDLE. I sure will give it a spin as soon as I can. Sign up for a free HUDDLE account.
My friend Owen just posted a question on instance to instance data sharing on the Flash Media List. I've sent him a piece of sample code which uses two instances of the same application and the help of a Proxied SharedObject to keep track of the current user count in each instance.
I think this code may be useful to some of you (there doesn't seem to much documentation on Proxied SharedObjects) so here it is.
As promised I am making the main working parts of my Snapshotter application available for download. Note that the zip contains an earlier version of the application and does not include the xml image gallery component. However all the core functionality which is the AS for taking the snapshots as well as the CFC code to make the flv to jpg conversion is included.
The code can be used without restriction under the MIT License. Let me know if you make any enhancements to the application, I'd be keen to see them.
A new experiment based on an application which I created for the London Flash Platform User Group. Snapshotter will capture a flv snapshot from your local webcam, send it to FMS, invoke a CFC via Remoting which in turn invokes ffmpeg which converts the flv to jpg format. The file is then written to an XML file and a gallery created which in turn is loaded in the swf. Sounds more complex than it is. I am going to post the sources (fla, cfc) for the conversion process in the next few days.
This is not your usual beta test - musical talent is needed (but I guess it doesn't matter if you lack it completely). Internetkaraoke.net is an online Karaoke service which offers over 5000 songs to sign along. The site is live but hasn't officially been launched yet and the developers have asked me for help beta testing the site. If you fancy having a go yourself then go to www.internetkaraoke.net and click on buy credit, then enter code 'fcomguru' to receive 20 free credits.
Please post your feedback in the comments of this post or email them to biffer AT biffcom.com The site uses Flash Video streaming courtesy of Akamai. Enjoy.
A big thank you to Andree Malave who has adapted my Flash Video Filters demo app to support captions. The text is loaded from an XML file and synced with the video as it plays. Note that FLVPLayback has been replaced with the MediaDisplay component (although it could also work with FLVPlayback).
Download source files
Yeah ok I was a bit bored so I grabbed the latest footage from my Sevenkay comrades (miss you guys), thrown in some ideas from Lee Brimelow's Flash8 Video DVD (*highly recommended by the way*), added Grant Skinner's excellent ColorMatrix class and out comes... well some nice looking video effects I think. The beast is a little CPU heavy and obviously serves no real purpose other than demoing what Flash8 is capable of. You can quite easily imagine some neat transitional effects between several clips in a playlist - or some nice fadeouts a la Gallery Incomplet.
Further down I have added some screenshots. Remember you need Flash Player 8 to view this... or maybe Flashobject's Expressinstall feature works and you're all converted now :-) What do you think to this? Would love to hear your comments.
Here's a very simple example on how to invoke and consume a WSDL webservice using serverside Actionscript. You will need Flash Media Server 2 for this, it will not work in Flash Communication Server.
The Webservice I am consuming in this example simply returns the currency exchange rate between two countries. For each country we must pass a string identifying the country, in this case I use 'UK' and 'USA'. What follows is pure ASC (serverside Actionscript). No .fla file or clientside code is needed to run this.
I have just added a second FlashCom port tester to my port tester page. Many thanks to my man Jake Hilton for providing it - it means I can add another freebie to my list. If you have free stuff to give away then get in touch ;-)
Following a really interesting thread on the chattyfig Flashcomm list I have now been able to put together a simple video player which is capable of requesting and playing parts of a flv video file that have not previously been downloaded.
This is a neat feature because it is usually only possible to play and seek to a part of a video that has already been downloaded unless you deploy a streaming media server. Here's the working example. You need Player 8 for this but that's only because I encoded the video using VP6. The rest is compatible with Player 7.
I have uploaded my progress and included all sources. It should be noted that due to the support of Buraks it was much easier to implement this idea. A new version of flvmdi injects an object containg two arrays into the flv's metadata. It contains the exact starting position in bytes and timecode of each keyframe. Using this information we can request any part of the flv file starting at a specified keyframe. Check this post for more info on flvmdi - the injection is NEEDED if you want the PHP seeking to work. Thanks to everyone on the chattyfig list who contributed to this and also to Brian Bailey for blogging about his efforts. Thanks also to Lee Brimelow whose scrubber I have used and modified for this app.
*** UPDATE ***
I have just added the sources to the old Flashcom bandwidth checker (which is now working again). Maybe you'll find them helpful.
|
|