Feeds:
Posts
Comments

I was working on fail-over architecture for our application and came across this <duplicateDir> tag in application.xml which, I am quite sure that many of you advanced FMS users already know or some of you might be already using it in your FMS based applications to support Fail-over.

I designed an architecture for our application in this architecture I was trying to keep the same folder hierarchy on both server.  So that if FMS (machine 1) stops working and users connects to same running instance from FMS (machine 2) they get the last updated data on FMS (machine 2) dumped through duplicate functionality from FMS1. There is a property in tag to attach application directory name to the path on other server or not i.e. by assigning value true you can add application directory name to the path or it will just copy the files at instance path. But when I was switching off the app directory name by assigning false it was just copying all sharedobject/streams at the root instead of at instance path. If I keep the app directory by assigning it  true.  It copies at correct path including instance path but attaching application directory path at beginning.

Anyway thinking that it’s some kind of bug or I might be doing something wrong. I posted a query regarding it on Flashcomguru mailing list and here comes the reply from FMS team member:

The <DuplicateDir> functionality for SharedObjects has been deprecated; it probably shouldn’t have been documented, my apologies. I’ve added a note to the online docs (comments appear at the bottom of the page):
http://help.adobe.com/en_US/FlashMediaServer/3.5_AdminGuide/WS5b3ccc516d4fbf351e63e3d119f2926bcf-7ff0.html

So what do we do now? I mean how do we achieve the duplicate directory functionality for fail-over in case we have planned for future? Or in case some of you were using it in past? So here is the reply from Adobe engineering team:

<DuplicateDir> won’t be supported moving forward and existing bugs won’t be fixed, so it’s not a good idea to use it.
You can use the File plug-in to build a fail-over architecture for streams.

So good luck for all the FMS developers who were or are in process of implementing failover architecture and were planning to or already using this duplicate directory in their architecture.

Some other good way to implement failover is to follow architecture suggested by Rober A. Colvin

I am just curious to know that will NAS/SAN introduce any kind of latency?  Compared to the files being stored on and delivered from same  machine?

Please let me know if anyone has any idea about it.

I have been evaluating JScrCap for a while now and finally i got something to write about. I got it working with both FMS and Wowza.  There are few pros and cons I am detailing below in the article.

Quality and memory usage is pretty good compare to the VH Capture which, we (flash media community) were used to use for screen-sharing applications.

You just have to put the JScrCap bundle on any web-server and use the JScrCap as an Applet in html page to start with(btw zip file available on Hmelyoff website does have the html page using which you can launch the applet). Just call the web page and it will prompt the client that there is an applet you want to run it or not. As soon as user clicks the run he is ready to share his screen through Flash media server or Wowza Media server.

FMS (Flash Media Server)

  1. You can’t use the default code i.e. SVC1 and also free codec used for screencapture with JScrCap utility as FMS doesn’t recognize this codec. Actually FMS  drops connection after first frame. Access log shows 419 x-status code, which means “License to receive screen sharing video failed”See more info or feedback from Flash community as Steafen puts in his blog.
  2. You can only use H264 codec for screencapture which does have licensing limitations.
  3. Using H264 you can’t reocrd flv file on server you can only create mp4 files. So in case you want to use FMS for screensharing using JScrCap and want to record the stream on server as well you have to make sure you record the incoming stream as mp4 stream not flv. Following is the error i see in log file if I try to record the h264 data as flv “2009-07-09 15:07:30 7180 (w)2611179 Warning from libflv.dll: Recording H264 to FLV is unsupported, tried in FLV :
    F:\RnD\FlashCom\FlashComm Applications\livestreamrecord\streams\_definst_\livestream.flv. -
    2009-07-09 15:09:03 7180 (e)2601163 Failed to record F:\RnD\FlashCom\FlashComm Applications\livestreamrecord\streams\_definst_\livestream, no space left on device -”

  4. You can record metadata in mp4 file using FMS.

Wowza Media Server

  1. You can use both codec i.e. default one SVC1 or H264 for screencapture.
  2. You can record flv or mp4 files using h264 codec in Wowza.
  3. Wowza doesn’t record data in mp4 stream. So if you want to access data across in recorded stream make sure you only record the stream as flv.
  4. JScrCap sent mouse coordinates data as onMouseData so in case you are using Wowza with JScrCap you have to listen on onMouseData on Netstream object. This was an update Vladimir done recently on request as earlier the way data was being sent across using JScrCap was only recognized by FMS not Wowza. It was pointed to me by Charlie that the wowza doesn’t record the metadata the way JScrCap is sending so he suggested the way it should be and thankfully Vladimir did it very quickly.
  5. The other major benefit of using Wowza is that you can use EC2 instance of wowza which has very less cost compared to the upfront cost you have to pay to get FMS.

I tested it on Windows and Mac and it worked fine. I think any user’s platform which will be able to run java applet through JVM etc. can have screensharing working through his system.

The other important thing I noticed in JScrcap notes is that SVC1 – works on all platforms, H264 – works only on Windows and MacOSX. So as FMS can only interpret h264 stream not SVC1  that means we wont be able to use screensharing on Linux machines with FMS we have to use Wowza there as it does recognize SVC1 compressed stream.

Please post your views regarding this article or if there is anything missing I can update it here.

Now you can add video to your slides in PowerPoint, create synchronized output with live video and PowerPoint and share using as flash output through authorstream website.

Here is more information in this regard.

Yesterday i was just going through my usual work when i got a client mail pointing to me that he is getting “Failed to Load RSL” and “Error #2032″. Not knowing the exact cause, I tried to dig into the issue and Googled for this. The only solution i could find is to use Failover swf file for RSL(Runtime Shared Library). But nothing concrete. Because serving a swf file instead of swz file was not the option i want to go with as the swf file will be placed in the browser cache, which many people clear from time to time, whereas swz file will be placed in the Flash player cache, which someone rarely reached to clear.

Then it came to my mind that it could be a #2032 i.e. stream error. That means that my application is not picking up the RSL i.e. framework_..swz file from the specified location. I checked the swz file and it was there. So tried to view that swz file in browser by browsing to that file manually http://……/framework..swz and to my surprize I got 404 page not found error.  What does that mean? it means that IIS is not able to stream that file to my browser or is not recognizing the file extension or mime-type. So i searched again for the .swz mime type, it’s the same as of swf file but only the extension is different so i updated it in IIS. Following are the steps to update in IIS:

Steps to update mime type in IIS:

1. Open up IIS

2. Move to website folder

3. Right click on web site folder/virtual directory and open properties

4. Open up HTTP Headers and click on button at bottom in the tab “File Type”

5. Click “New Type”

6. Enter ‘.swz’ without quotes in Associations Extension and ‘application/x-shockwave-flash‘ without qoutes in Content type (MIME). Click ok and and you are ready to go.

This article is an update to the previous one i have written i.e. picking up domain name….
It’s a new problem i noticed while using ExternalInterface in flash file and embedding that swf file in asp.net web pages and within form tags

The problem starts when we have our flash player (with External Interface call) embedded inside a form tag that is mostly in ASP.net web pages which use runat server controls. Most of IE version 6 and IE 7 starts giving error:’try { flashplayer.SetReturnValue(__flash__toXML(window.location.hostname.toString()) ); } catch (e) { flashplayer.SetReturnValue(“”); }’ or ‘flash player id undefined’
Looking at various websites and finally on livedocs I was able to find the solution/workaround to the problem: Just add following line after your flash file embed code in which you are using any ExternalInterface call.

window.[flashplayer id used in embed code] = document.getElementById(['flash player id used in embed code']).

This will add a window level pointer to the movie so that it can be referenced directly using id/name. As this is only required in case of IE you can put condition for it’s execution only in case of IE.

This problem was bugging me for a long time and I was not able to find the solution until recently when I dug into few internet blogs again for sometime and was able to crack the problem.

Actually this was a request that came up to me last year for tracking the IPs or domain name where our flash application/player is blogged or embedded. The only solution then I was thinking of was _root._url. But that was of no use as the flash player was being picked from our website and it was returning the URL of our website then the website where it was embedded. I even thought of getURL but it was not useful in this solution. I never worked with
ExternalInterface much at that time and never thought it will be of any use as such for me as I thought its functionality is almost like getURL so it will be same as getURL.

So I never dug deep into ExternalInterface at that time and I just thought whenever we try to send some variable to through sendAndLoadVar to our domain for tracking the visit count why not try to read the request header. Maybe request header will have the domain information in http-referrer or somewhere. But when we tried to dig deep into that we found that it’s the client ip information which we receive in the request header not the domain information so that solution was too ruled out.

This year again when I was approached for the solution I thought do some more search & research. I came across this blog of abdul qabiz; there in one thread I found some useful information and came across a mention of another website “http://www.flexpasta.com/index.php/2008/03/15/getting-url-parameters-host-name-port-in-flex-actionscript/” target=”_blank”>Flex Pasta“. There I found the solution to my problem that I can use
ExternalInterface to get this domain information and many other information variables like port or URL parameters.

So here I found the solution. I created a small code snippet to test it and see how it’s working on a different domain; I created 2 text fields on stage in AS2 file:

ActionScript 2:

import flash.external.ExternalInterface;   

try{
	txtDomain.text = ExternalInterface.call("window.location.hostname.toString");
}catch (myError:Error) {
	txtError.text = ("error: "+myError);
}

So it worked locally for me. But when I hosted this file on one website and pasted embed code in one blog, I got null as the value in the textfield. Then I tried to look into the Adobe help docs; there I found that if any error occurred it will return null. So I just tried to do some checkup on the Internet and then I found that allowScriptAccess must always be set as always; then only it will return the value.

So I am again stuck in the middle! I will be able to return the track of only those blogs, which will allow me to embed the code with allowscriptaccess as always but due to security threats many of the major blogs have already changed it; they have set it’s value as never so you can’t embed any third party swf file into these blogs with allowscriptaccess tag with value other then never. So does that mean you can’t get domain name track backs from these blogs? I tried to do try catch as you see in the above code but nothing was returned in AS2 other then null.

So I read one comment in the Abdul Qabiz blog that he got a security error back in try catch and in that string he got where it was occurred along with the swf file path. I tried that in ActionScript3/CS3 file something like this:

import flash.external.ExternalInterface;

var loc:*;
try{
	loc = ExternalInterface.call("window.location.href.toString");
}catch (e:SecurityError) {
	test.text = ("error caught: "+e);
}
txtDomain.text = String(loc);

I mentioned the variable type of loc as “*” because I read a comment from senocular on Flashkit that the variable returned by ExternalInterface.call is of type “*”. When I tried to assign that value to textfield it gave me an error: TypeError: Error #2007: Parameter text must be non-null. So there I have to typecast the variable as String to remove the error. Now when I published the file and tried that with ‘allowscriptaccess’ set to ‘never’ in embed code, I got a flash player error alert popup which said that the following swf can’t access the following html file in which it is embedded.

Now as html page is hosted on the domain for which I was looking i.e. I can parse out the domain name from that error but an alert is not something a visitor likes to see. I put that call in try catch and got the error trace which has domain name in html page reference in catch block.

Similarly if you want to do it in Flex application you can do it something like:

import flash.external.ExternalInterface;

private var dom:*;
private function init():void{
	try{
		dom = ExternalInterface.call("window.location.hostname.toString");
	}catch(e:SecurityError){
		dom = "error: " + e.toString();
	}
}

Init method can be called up on creation complete event of application.

Another problem which I came across this whole process was that during my tracing I noticed that although I can trace up external interface call in Firefox and Safari but Internet Explorer was not responding to the call. When I dug upon it a bit I found on one of the forums that specifying the flash file id in Object tag is a must to make sure your ExternalInterface call go through and return you a value. For e.g.<object classid=’clsid:d27cdb6e-ae6d-11cf-96b8-444553540000′ width=’481′ height=’402′ id=’player’>

Hello World!

Hello World,

I am Vivek Lakhanpal. Starting yet another blog in the huge pile of blogs. You can know about me in “About Me” section. I will try to take up some flash related topics and see how it comes up like how best i can serve the community back who is helping me out in some or other way for so long :) .