
The new Flash Player 9 places a lot on emphasis on the security of streamed content audio and video. A previous Papervision hack allowed access to rtpm content by disconnecting "from the stream, doing a .draw() to a bitmapdata, and reconnecting. This procedure enabled streaming video to be played on a 3D plane". This is no longer possible.
However all is not lost. Flash Media Interactive Server 3 has a property of the Client class, "videoSampleAccess". This property allows the Flash Player read the raw uncompressed video data streamed from the server. Using this property you can set permissions for access to video data in designated folders. To use streamed video from FMIS set up the following statement in your server script.
application.onConnect = function(newClient){this.acceptConnection(newClient);//newClient.videoSampleAccess = 'pv3dstrms';
newClient.videoSampleAccess = '/';The newClient.videoSampleAccess property allows the client application access to raw data of the video streamed from a target folder ( 'pv3dstrms' ) or any/all stream folders/ subfolders ('/') . On the client side set up your usual scaffolding to connect to Flash Media Interactive Server, set up your Video object, and your Netstream. Pass them as arguments to the VideoStreamMaterial. Assign the material to the primitive.
_vns = new NetStream(_vnc); _vns.play("sample_c"); _cvidmat= new VideoStreamMaterial( new Video(), _vns); _cube = new Cube( new MaterialsList({all:_cvidmat}), 300, 300, 300, 1, 1, 1, 0, 0):*IMPORTANT: In your Event.ENTER_FRAME listener method put in the
.updateBitmap(). Using the VideoStreamMaterial declared above it will be, _cvidmat.updateBitmap()
** Open the file VideoStreamMaterial.as in the PV3D materials classes folder and comment out the following statement :
"//this.video.attachNetStream ( null );"
Run your application.
Voila, you will be streaming video from FMIS.
*~* This method of FMIS/Papervision Video Streaming was tested with Great White and Effects branches of Papervision 2.0
*** I have not tried this on any other RTMP Socket server, so I cannot guarantee success with Red5, haXeVideo or Wowza but, it works for FMIS 3. I unfortunately cannot give a live preview as I go not have a public FMIS 3 install.

When a colleague of mine told me about a great new free image processor at par with Photoshop, I must confess I needed to see it with my own eyes to believe it. I've never been a great fan of Photoshop. I've always found it too fiddly and those layers drive me mental. To be sure it has a few features I've grown to love but if those were offered else where I'd probably never open Photoshop. Corel Painter yes, I swear by it, Fireworks, in my view pure genius. Welcome a new addition to the party and a FREE offering as well. Its called Paint.NET, and yes its a C# build on the .NET framework. Its seems to do all the stuff PS does for free and it takes a tenth of the time to initialize. Its an Open Source project so if you wish, (God knows I won't) you can go and ferret around in the code. Its all there.
Papervision3D is an amazing 3D engine but setting up the classes to create a Papervision application can be a real pain in the whotsits. Well, Andy Zupko has once again come to the rescue with a new addition to the PV3D API, the BasicView class. In a nutshell, the BAsicView class creates all the scafolding required to create a well.. basic PV3D scene. It has its own Scene3D, ViewPorts the lot. With the BasicView class all you need to set up a PV3D scene is:
AS 3.0 version:
_bview = new BasicView( stage.width, stage.height, true, false, 'CAMERA3D' );
addChild(_bview);
Add your loop event listener for the Event.ENTER_FRAME and off you go.
function loop(e:Event):void
{
_bview.singleRender();
}
There is a slight difference when deploying this in Flex. The FlexSDK will grumble and throw-up errors if you try to add the BasicView to its display stack. Use it in Flex in the following manner within your mx:Script tags
Flex version:
_bview = new BasicView( stage.width, stage.height, true, false, 'CAMERA3D' );
rawChildren.addChild(_bview);
The rawChildren property allows you add non-native Flex displayObjects to the Flex display stack.
Thats it.

What a week it has been, exciting and frustating in equal parts. I had virtually no internet at work today and it really spoiled what was so far a decent week. It was "one of those days at the office". Its truly amazing how helpless and depressed it can make one feel. Its also scary to think of how dependent I have become on the internet. I really must find some way to decrease that dependence without affecting my output.
On the plus side 2 days ago one of my major passions got an upgrade. Yes, the new Flash Media Interactive Server is finally on general release. A fantastic job by the Adobe FMIS gang. They really put them selves at the knife's edge for this one and its capabilities are truly breathtaking.
- Off the shelf Video On Demand deployment
- Support for H264 encoded videos
- Support for ACC encoded audio
- An expanded and more granular Server scripting API
- No Bandwidth or Concurrent connection caps (just fabulous)
- Flash Lite Streaming
- Optimized Bandwidth management
- Auto Bandwidth management
and thats just off the top of my head..
Do take it for a Spin.
My second passion Papervision3d got an unexpected boost in the release of a 3d Physics API appropriately named WOW Physics engine. A fantastic complement to the PV3D API. It's fabulous, considering the fact that it is soooo very early in its development. Here are a couple of
flaming balls in a WOW bounding box. I'm really jazzed at the possibilities this new API will provide.
Code

I just discovered "Pidgin", not in the Nigerian/ Ghanian context of pidgin english but, a really nice open source IM aggregator. No more IM hopping for me, Messenger and Google-Talk accounts all in one place. It supports a whole gang of other IM clients - though I cannot remember seeing Skype on the list. Still, a wonderful utility.
Go on, speak
"Pidgin" here
I'm a great fan of the Strategy Pattern. Its one of those "good ideas" of OOP thats seems so basic you wonder why you never thought of it before. The problem with employing Strategy for me has always been the best way to achieve interclass communication without compromising their loose coupled architecture. My great escape has always been the MVC triad since it is a compound of the Strategy, Composite and Observer pattern (Smalltalk). Then there is the option of a Delegation Event model - nicely explained by Mr Moock in his AS2 tome.

However the the "Daddy" of all the alternatives is the
Mediator. Simply put, "The mediator object: encapsulates all interconnections, acts as the hub of communication, is responsible for controlling and coordinating the interactions of its clients, and promotes loose coupling by keeping objects from referring to each other explicitly." Loose coupling between each class is achieved by having the classes communicate with the Mediator, rather than with each other.
It works at its most rudimenary in the following fashion, ClassA is composed of a couple of classes, ClassB and ClassC. The nature of the application requires that instructions need to be passed from B to C, yet they need to remain completely independent of each other. Enter the Mediator, that "mediates" between both B and C by standing as an intermediary and passing instructions from B to C and vice-versa.
The only "fly in the ointment" is the fact that Mediators do not seem to be very reusable, but then neither are Models.
London can do this to a person.
9ish this morning I was on the Northern Line reading, well trying to understand the Chain of Responsibility when, I heard the train alarm beeping. "Bugger", I thought, "What now?", +30 mins added to the trip."We have a problem and will be stopping for a few minutes at the next station", said the train driver on the P.A. system. We pulled into Archway Underground station and stopped. Strangely enough the drama was happening a few meters from me on the train. Somebody who I could not see through the sea of legs was sitting, or more like sprawled on the floor crying. I resisted the impulse to stand up and peep, besides there were enough people asking what the problem was. "I'M STRESSED", was the cry for help I heard between sobs, "TOTALLY STRESSED OUT". The accent was not English, and sounded a bit African though not one I could identify. Yes I thought, London can do that to you. The train driver and assistants helped the poor person of the train and the daily routine of cosmopolitan London continued.


I've been experimenting with the PixelField since Andy Zupko intoduced the class into he Papervision3d Effects API. Its one of those classes what seems to turn up something unexpected at every turn. Here is another effect created from the ParticleField class using a Blur filter.
The Code
I'm one of those who, to quote the BritishTelecom ad "have gone back to FlashDevelop". Its just a wonderful IDE.
***However there is a point to note. While selecting the Debug options for viewing your swf's. The player used for the Popup option, seems to suffer a performance hit against the player used for the External option. I compiled a swf which seemed to really struggle when I used the Popup player but ran smoothly when I viewed it in the External player. I'm trying to find out why this is so.
I was looking at an article I wrote a while back and was reminded of a feature of Flash Media Interactive Server, I like a great deal, the virtual directory for streams. Its quite an old feature. It allows the developer to create a folder anywhere on the Server machine and set a name value pair as an identifier to this folder. As a result any FMIS ( or any earlier server FCS or FMS) application can access the streams in this folder by prefixing the required stream with this variable name,
e.g aStream,play("VDir:"+ RecStrm),
Till now this feature could only be set my making changes to the "Streams" tag in the VHost.xml configuration document:
VirtualDirectory>
Streams>
radiostreams;c:/mycustomstrms
/Streams >
/VirtualDirectory>
to use this your server code may be:
aStream,play("radiostreams:"+ RecStrm),
FMIS now offers the ability to programatically set up a virtual directory from the server script. The Stream static method Stream.setVirtualPath(id, path).
It is used in the following manner:
Stream.setVirtualPath("JamSession", "C:/Documents and Settings/aYo/My Documents/My Music");
A particularly useful use case is an FMIS radio station, with each music channel set up as a separate instance of the application, or even a separate application altogether. Nonetheless all instances share a single music vault set up as a virtual directory. Were this not the case each channel would have to have its own streams folder which will definitely need to duplicate data, an unnecessary waste of disc space.