Embedded Flash Player is not working from another domain (Cross-Domain swf access )

When I used an flv player for my website www.amvizone.com, the main problem I faced was the external embedding. So I provided the iframe embedddng method instead of embedded object like youtube. The problem was the embedded flash player only worked with the my domain (where the player.swf is placed). When I put the same embedded code with src points to http://www.amvizone.com/player.swf from another domain, the player did not work.

FLV Player

Recently My Friend Rahul (He is the master in flash and action scripts) gave me a solution for this. That is, you have to add cross-domain policy to your server to server the swf file to other domains.

When a Flash document attempts to access data from another domain, Flash Player automatically attempts to load a policy file from that domain. If the domain of the Flash document that is attempting to access the data is included in the policy file, the data is automatically accessible.

You have to create a file, crossdomain.xml and place in the root folder or any other folder where content is placed. The data in the crossdomain.xml file is shown below:

1
2
3
4
5
6
7
8
9
<?xml version="1.0"?><!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="www.friendOfFoo.com" />
<allow-access-from domain="*.foo.com" />
<allow-access-from domain="105.216.0.40" />

1
</cross-domain-policy>

The above configuration allow any subdomains of foo.com or a particular ip 105.216.0.40 or www.friendOfFoo.com

If you need to provide access to all domains , you can use the following xml:

1
2
3
4
5
6
7
8
9
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

Courtesy: Adobe.com

And special thanks to Rahul for sharing the information

For details: click here

Regards

Sajith M.R

7 Comments , , , , , , , ,

7 Responses to “Embedded Flash Player is not working from another domain (Cross-Domain swf access )”

  1. chrisfreak August 2, 2008 at 12:50 pm #

    Thank you, you’ve saved my life

  2. dream travel February 16, 2009 at 7:06 pm #

    just wonderful !! you saved me so much work !

  3. john locke June 3, 2009 at 5:24 am #

    What is the best media player?

  4. Albarsark November 17, 2009 at 3:31 pm #

    hi sajith,
    i try to direct embedded cooliris on my documents and need this xml.
    i’v got the same problem and i foud the same solution U describe here BUT none!!! i try many time….different things…
    do u thing it’s a wordpress problem ? not a xml ? a dtd ?
    look here i describe better http://albarsark.com/wordpress/?cat=28
    but I already succed for embedding cooiris on my page for external source like u can see on the same page…
    Thanks
    @+
    Albarsark

  5. mr_private May 21, 2010 at 8:10 pm #

    please help,
    my embeded code from ning i place it to my site since ning disable its site…i cnt play the videos from the embeded code. please help…can i still play my videos with my embeded videos..pls email me…..this is one of my embeded video

    Find more videos like this on showgurls_pinays

  6. webgod September 29, 2010 at 8:39 am #

    Thanks, for good script

  7. webgod September 29, 2010 at 8:59 am #

    Thanks for good knife army script.

Leave a Reply

More in webworld (26 of 63 articles)


Do you wanna inform any important news or message to your readers ? Here is a simple plugin, Wordpress ...