FLVPlayer common Problems (remote file access and instancing compiler-time problem)

FLV player is cool component that provides easy video streaming and displaying management, but, there are some common problems that new users may experience:

1. - Can’t display remote file (FLV stored on some web server, even if file is nest to caller SWF)

2. - When instancing FLAPlayer from fl.video.FLVPlayback; you are getting compiling-time error that fl.video.FLVPlayback definition couldn’t be found.

1. Problem is about security handling.

The simplest way to avoid this problem, is to put

crossdomain.xml file with content like this:

<?xml version=”1.0″?>
<!– http://www.adobe.com/crossdomain.xml –>
<cross-domain-policy>
<allow-access-from domain=”*” />
</cross-domain-policy>

this is example from Adobe’s site. Like this you’re allowing access from all domains to resource files in folder where this XML is. (this will allow .FLV, .SWF .XML and other files to be loaded from domain with crossdomain.xml). In case where you don’t have access to domain’s root, you may include such code in SWF file that is being loaded (alternativly, you can use SWF files with FVL player integrated inside it)

Security
.allowDomain(”www.example.com”)

where www.example.com is domain which contains resource files, with remote files.

and simpler solution could be to load crossdomain.xml file from alternative location inside domain with:

Security.loadPolicyFile(”http://socketServerHost.com/crossdomain.xml”)

2. It’s really strange that you can’t instance FLVPlayer object from code if you don’t have instanced component from Flash Component library and set it somewhere to stage or in asset library. So, solution is to check:

1. if you have properĀ  import fl.video.FLVPlayback;
statement at begining of your code

2. and if you have FLVPlayer in library asset.

Leave a Reply


tesseractstudio.org | all rights reserved 2005-2008. | tesseractstudio ltd, Serbia
omnetwork.net | tutorialautomated.info | osgamer.org | freeflashscripts.com | tesslabs.com | thefirstexodus.com | thefirstexodus.com