Influxis Flash Media Interactive Server 3.5 Hosting Specialists


Posts Tagged ‘flash’

Influxis + AIR for Android = Awesome!

Wednesday, July 21st, 2010

Today Mashable posted an article on how AIR for Android can help Android compete with Apple’s Facetime Mobile Video Chat system which you can find here:

http://mashable.com/2010/07/20/android-video-calling/

Of course we need to wait for Android devices that not only have forward cameras (EVO) but also access to FroYo (Android OS 2.2).  But once that happens you can port your own Video Chat code you’ve been using for years with FMS to AIR for Android within 5 minutes!

First, open your Video Chat App and change the Publish Settings to AIR Android.  Then add this to your VideoChatApp-app.xml:
<android>
<manifestAdditions>
<manifest>
<data><![CDATA[
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
]]></data>
</manifest>
</manifestAdditions>
</android>

And that’s it!  You’ve got your Flash based version of Facetime, but it’s a little bit better, because ours goes to the Web as well.  Pretty awesome right?  I’ll be updating tomorrow with code for RTMP based Mobile Video Chat and RTMFP based Mobile Video Chat, Multicasting, Audio Chat (Skype), and Text Chat.

Stay tuned!

TVStation2 version 0.6.1 Released!

Wednesday, June 30th, 2010
tv2_0_6_1_labs

Click here for the live demo

The next update to TVStation2 is finally out. This version has several bug fixes, new features, and a new viewer skin.  Here is a rundown of all the changes:

The following issues have been resolved:
(more…)

Smashstream and the future of Flash Media Streaming.

Monday, June 28th, 2010

SmashStream!

For a while now, I’ve been talking about the awesome new Real Time Media Flow Protocol (RTMFP), and how it’s a major evolution for the Flash Player.  Unfortunately, Peer to Peer server systems are not the easiest things to be blown away by.  Who really knows how amazing a Distributed Hash Table is?  Or that NetGroups are essentially using a Ring Topology?   Answer: less than 100 people.

(more…)

Case Study: Ricca Racing In-Car Streaming

Friday, June 25th, 2010

Ricca Racing does its first live in-car streaming at 150 mph with Influxis’ Flash Media Interactive Server hosting.

Company: Ricca Racing (www.riccaracing.com)

Ricca Racing Contact: Matt Espinoza, Chief Technology Officer

Influxis Contact: Grant Garrett, VP of Global Business Development (Twitter: @influxisgrant)

The video camera aboard the race car to stream the video live.

The video camera aboard the race car to stream the video live.

Challenges

  • Ricca Racing, a subsidiary of 240SXMotoring, needed a reliable streaming host to distribute the live audio/video stream coming out of their race car. It had to be cost effective and customizable to their needs with a no-nonsense solution in addition to top-notch customer support. The landscape of Redline Time Attack is fast paced and unpredictable so proven reliability is a must. This all went down at the New Jersey Motorsports Park in Melville on April 10 ~ 11.
  • The connection to the FMS server needed to be straight forward and able to recover quickly from rapid connects and disconnects since the live streaming location was switched rapidly between the car and the pit during the race.

(more…)

Influxis OSMFPlayer v1.0 is the Official New “Influxis Video Player”

Monday, June 21st, 2010
OSMFPlayer

Click the picture for a demo of the Influxis OSMF player.

The Influxis OSMF Video Player is an all new media player built using the Adobe Open Source Media Framework. The player is light, fast and feature-packed. It supports:

  1. Video on demand
  2. Live broadcast playback
  3. Live DVR broadcast playback using the Adobe DVRCast API
  4. Dynamic Stream Switching (DDS)
  5. YouTube content playback
  6. Adobe Zeri server playback (HTTP Streaming)

Furthermore, it has a wide set of API’s that will allow our customers to customize the player in a variety of different ways.

This new Influxis OSMF Video Player is useful for those wanting a modern and extremely light-weight player to use on their websites, blogs, etc.

It is available to all Influxis customers from the Influxis Wizard where it comes with a video player builder allowing for easy customization of logo placement, custom video command bar, video player sizing and more.

For Influxis customers:
The player is available now through the Influxis Wizard> Influxis Player Builder.

For non-Influxis customers:
A free version of this player can be downloaded from here. By downloading the free version you agree to the terms of use.

Note: The free version of this player is not available for reselling purposes. An open source version of this player will be released soon, so stay posted.

Synx Platform: Video Playback

Friday, February 26th, 2010

Here at Influxis, we support all the interactive features that Flash Media Interactive Server provides, but the most common use for FMS is still video streaming. Knowing this, we made streaming even easier with Synx.

Just like before, we use the Synx class to get everything set up and ready to use. For playback, we initialize the Synx class with the URI where our videos are located on FMS. After the platform is initialized, we create an instance of the StreamingConnection class and listen for StreamingEvent.READY.

1
2
3
4
5
6
7
8
9
10
11
12
import com.synxplatform.core.Synx;
import com.synxplatform.fms.streaming.StreamingConnection;
import com.synxplatform.fms.streaming.events.StreamingEvent;
 
private var stream:StreamingConnection;
 
private function init():void
{
    Synx.init("rtmp://youraccount.rtmphost.com/videos/");
    stream = new StreamingConnection();
    stream.addEventListener(StreamingEvent.READY, setup, false, 0, true);
}

The setup method is pretty simple, too. We create a Video object, attach the stream object’s NetStream to it, then add it as a child to the application. After that, we use the StreamingConnection’s PlaybackController object, stream.playback, to call the addToPlaylist() method for each video we’d like to play, in order. If we want our entire playlist to loop playback, we set the PlaybackController’s loopPlayback property to true. Finally, to start playback, we call stream.playback.play().

13
14
15
16
17
18
19
20
21
22
23
private function setup(event:StreamingEvent):void
{
    var playback:Video = new Video();
    playback.attachNetStream(stream.ns);
    this.addChild(playback);
    stream.control.addToPlaylist("video1");
    stream.control.addToPlaylist("video2");
    stream.control.addToPlaylist("video3");
    stream.control.loopPlayback = true;
    stream.control.play();
}

That’s all it takes to build a simple video playback application with the Synx Platform. Next, we’ll discuss building a full video player with Synx, and recording video and audio to FMS from the user’s Camera and Microphone objects.

Game Development with FMS series: The Client Object.

Friday, February 26th, 2010

Welcome to the first in (hopefully) a long series of posts on the secrets of making games with Flash Media Server.  Flash Media Server is typically not mentioned when the Flash Gaming Community talks about Multiplayer Development.  I’m here to change that, and in order to understand what FMS is able to do, you MUST understand the Client Object.

I’ve noticed that most Flash Developers have gotten into the habit of doing something like this when they are setting up their NetConnection:

nc = new NetConnection( );
nc.client = this;
nc.connect (rtmpAddress);
nc.addEventListener (NetStatusEvent.NET_STATUS, fmsNCStatus);

Actually, a lot don’t even know about the nc.client = this; I think.

It’s time to take our ritalin and put the knives away, because school is in session!  First of all, what the hell is the client?

client property

client:Object [read-write]

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Indicates the object on which callback methods should be invoked. The default is this NetConnection instance. If you set the client property to another object, callback methods will be invoked on that object.

Um, yeah, that’s whatever, right?  Well, it’s actually awesome sauce, the keywords are Callback Methods Invoked, but wait, callbacks from where?  The server yo, the freakin’ server that’s where, and no, we are not using Shared Objects. I’ll explain why not later.

Since most flash devs have developed an allergy to AS1 I am going to provide a code template for you that you can use in most cases.  You might actually learn to kinda like AS1/JavaScript 1.5, because it’s way easy.

application.onAppStart = function()
{
	this.maxClients = 8;
};
 
application.onConnect = function(currentClient, username)
{
	 	var nClients = application.clients.length;
 
	 	if( nClients + 1 &gt; application.maxClients )
		{
		 	trace("Too many users, rejecting client.");
		 	this.rejectConnection( currentClient);
		 } else {
			 trace("Allow User");
			 currentClient.name = username;
			 application.acceptConnection( currentClient );
		}
		currentClient.transmitChat = function(textChat)
		{
			application.broadcastMsg("receiveTextChat", currentClient.name, textChat);
		}
};
 
application.onDisconnect = function(currentClient)
{
	application.broadcastMsg("clientDisconnect", currentClient.name);
};

That is all the server side code you need for a basic chat application (I know, why is every example a chat?). On starting the app we limit the clients that can connect to 8, this will be very useful for gaming, because we’ll be looking at this later as a ChatRoom. And we’ll later setup another FMS based Application that will be our Authoritative Game Server which will keep track of the Games being played, and which ones are available for more players, or the ability to make your own Private Game. That will be gone over later in the series.

Back to the server code above, most of what we are looking at is inside the application.onConnect. That is the method that is called whenever anyone connects to the Server, and they pass in currentClient (The Current Client Object attached to the person connecting), and their username (A String that you get from your Client Application). Here’s how you would call that from your AS3:

public function initFMS(rtmpAddress:String, name:String):void{
        //Here we instantiate our ClientObject
 
         clientObject = new Object();
 
        //Here we setup our Callback Methods
 
	clientObject["receiveTextChat"] = remoteTextChat;
	clientObject["clientDisconnect"] = remoteClientDisconnect;
 
	//And finally our NetConnection
 
	nc = new NetConnection();
	nc.client = clientObject;
        nc.connect (rtmpAddress, name);
	nc.addEventListener (NetStatusEvent.NET_STATUS, fmsNCStatus);
}
 
public function transmitChat(textChat:String):void
{
	nc.call("transmitChat", null, textChat);
}
 
private function remoteTextChat(username:String, textChat:String):void
{
	currentTextChat = username+": "+textChat+"\n";
	trace(currentTextChat);
	dispatchEvent(new Event(FMSConnectorExample.CHATRECEIVED));
}

Here’s what is going on, clientObject["receiveTextChat"] = remoteTextChat; sets up the Callback function that will be called from the server. The transmitChat method in the AS3 is doing a nc.call(”transmitChat”, null, String(textChat)); which calls what we setup on the server. The server code is:

currentClient.transmitChat = function(textChat)
{
application.broadcastMsg(”receiveTextChat”, currentClient.name, textChat);
}

This is where it gets cool, because application.broadcastMsg is calling receiveTextChat on all of the connected client’s clientObject. So what that does is allow for each client to call the server, pass a string, and then the server broadcasts the string back to all the clients with the sender’s name. Nice right?

Well, that’s cool and all, but how does this apply to games? With this Template you could send Player State Updates, Entire Objects that have Events/Positional Data/Names anything you want really. Just remember the more information you send the slower and more bandwidth intensive it gets. This is also how RTMFP/Flash P2P works as well. It’s all about the client object.

Next post will build off of this code, and will show you a basic game example via RTMP AND RTMFP.

Please leave comments on whether or not this was helpful, or if I need to take it even slower. I’ll be happy to answer as many questions as I possibly can.

Download the code for this tutorial:

ClientObjectServersideExample

Synx Platform Preview

Friday, February 19th, 2010

It’s almost here.

I know I’ve been kind of quiet since my position with Influxis was announced last year, and with good reason. I’ve been working in my laboratory (read: basement office) on some really cool stuff for anybody who develops for, or would like to develop for, Flash Media Server. One of the things I first noticed about being an FMS developer was the repetitive nature of a ton of the things we do when building applications. Creating a NetConnection, creating a NetStream, handling SharedObjects, listening for NetStatus messages… and it seemed to me that there had to be a better way. The rest of the team agreed, and I started working on an AS3 micro-architecture for FMS applications, the Synx Platform. It’s built to make a ton of things simple, and like I said above, it’s almost ready to be given to all of you. (more…)

Special Screening of Orchid @ MAX

Sunday, October 4th, 2009

OrchidLogoTmp

Influxis, in association with 11th Principle, is proud to present Orchid; an Open Source Software Development Kit for Adobe’s Flash® Platform. Orchid is our internal framework used to build our next generation products and services. Written in Actionscript 3.0, Orchid consists of a core set of object-oriented frameworks that provide a light-weight runtime environment for applications running on Flash®. Designed from the ground up to be an easy to use framework, Orchid allows for the productive and efficient pairing of developers with designers.

Key Features

  • Provides a light-weight mechanism that allows Objects to communicate
    with each other at runtime.
  • Inversion of Control.
  • Provides a mechanism for creating applications that can be initialised
    without having to load the entire application container.
  • Introduces object wrappers for programatic primitives. These include
    integers, arrays, booleans and strings.
  • Widgets or classes that implement some soft of graphic user interface
    (e.g. Button, CheckBox, Slider, Lists, etc.)
  • Extremely easy to skin widgets(UI controls) using Flash® CS4 Authoring.
  • Introduces a modular yet easy to use viewpoints framework for Actionscript 3.0

Influxis will be presenting a special showing of Orchid during Adobe’s Max Conference this year in Los Angeles. More details to emerge real soon so be sure and check back!

Project Variant and a question to the community.

Wednesday, September 23rd, 2009

Last week I posted on twitter a link to this vid:

VariantWhat the hell was that?  The most boring music video ever with the music too loud and a bunch of black at the end (sorry, I made that after a long night of coding at the wee hours of 5AM)?

Yeah, pretty much.

Yes, that was Actionscript 3 driving that hardware accelerated 3d engine.  Yes, that was a modified version of the AVM2 or Tamarin VM.  Yes, that was 200 Frames Per Second, with a pretty decent amount of polys.  Now for what it wasn’t:  that was not the flash player rendering that.  The awesome Irrlicht 3d engine was doing all of the heavy lifting on that.

Basically, Tamarin set up the Irrlicht 3d engine to run, which was a successful proof of concept that yes, AS3 could be the scripting language for a 3d engine which could rival Unity 3d.  Awesome!  It also allowed for you to use the Flash Projector to output an executable of your AS3 driven version of Irrlicht, and thus mimics the Adobe Integrated Runtime (a.k.a. AIR) model.  That’s doubly awesome!  Right?

So?  Um, what’s the problem Brosef Stallin?

Have you happened to use Tamarin lately?  If you haven’t. . . let me help you get started:

First link is a pdf explaining what the AVM2 does.

Then build it (note: this is the easiest part).

Then add your own Native Classes to it. Welcome to Manifest/Make file hell.

Or, just use the awesome project Red Tamarin to get yourself up and running.  You should look at Zwetan’s blog as well for some tasty morsels of knowledge (a seriously smart dude).

Other sources of interest on this subject include: RedRocketServer, Campell Anderson’s Blog, and the Mod-Actionscript Project.

So, if you didn’t notice the pattern here, let me spell it out for you.

1.  The AVM2 is in C++, and there is very very very little documentation on it.  The Red Tamarin project does the best job at this point of getting you in to the AVMPLUS and Shell libraries (check the avmcore.cpp and avmcore.h to find some morsels of goodness, and then the src/shell/avmshell.h).

2.  While it was cool that Adobe released the AVM2 to the public, they didn’t release the rest of the Flash Player to you.  It’s like trying to learn how an automobile engine works with just the transmission (I don’t know I’m not a car guy).  You don’t have any access to the display/GUI at all.  It’s almost a dead end.

3.  The only way to compile your .AS code with the avmplus.exe is via the command line open source Flex Compiler.  Which is very scary to a lot of people.  Yeah, I could write a python script or something for you, but it will still not be pretty.  And it would be too much work for all but the most Obsessive Hackers out there.

4.  Did I mention we had to modify the AVM2 for all of this?  So that means this will not work in the Holy Grail. . . the Flash Player.  Although, I could use the QT Framework and bust out a cross platform browser plug in that would run Irrlicht in the browser via your AS3 script.  But that’s a plug in that people have to download!  Gasp!  And then the whole reason for using flash kinda goes out the window right?  We give up the godlike(all together now) Flash Penetration Rate for a 3d engine that can output more then 20,000 polygons without having to jump through hoops of fire.

Now, I’m going to go interactive on you!  Get ready yo. . . a question!

What do you guys think?  Would you like Variant to be built out?  Would you use it if I spent my precious (imagine my adorable family crying right now) time on this?  Could we get someone from Adobe to weigh in on this?  I know that I could build this out for the new version of AIR that is going to be released with a Native Code API.  Do you guys even freakin’ care about high resolution/high framerate 3d in flash?  Would you like a new IDE like Unity 3d but with the option to treat every 3d object like a MovieClip?

Please, feedback is welcome.  Oh, and do you want the .exe example that is shown in the video to play with?

Good night and good luck.

P.S.

If you were interested in the AVM2 and would like to follow Red Tamarin please follow @zwetan

And if you are interested in Red Rocket Server, please follow @campbell

They deserve twitter love, they are awesome.