Access path for crossdomain.xml file for jwplayer

I am using JWPlayer to stream video from Azure blob storage, JWPlayer needs crossdomain.xml

to play the video.

I tried to put the file crossdomain.xml

in the root directory and the code in

, but JWPlayer looks for it in


Do I need to redirect JWPlayer to

instead of default



source to share

2 answers

I often use this piece of code to create a Crossdomainpolicy:

var account = CloudStorageAccount.Parse(ConfigurationManager.AppSettings[ConfigKey]);
            var blobs = account.CreateCloudBlobClient();

 private static void CreateCrossDomainPolicy(CloudBlobClient blobs)
                new BlobContainerPermissions()
                    PublicAccess = BlobContainerPublicAccessType.Blob
            var blob = blobs.GetBlobReference("clientaccesspolicy.xml");
            blob.Properties.ContentType = "text/xml";
            blob.UploadText(@"<?xml version=""1.0"" encoding=""utf-8""?>
                      <allow-from http-methods=""*"" http-request-headers=""*"">
                        <domain uri=""*"" />
                        <domain uri=""http://*"" />
                        <resource path=""/"" include-subpaths=""true"" />
        catch (Exception Ex)
            throw Ex;


In ConfigKey I will pass my account to Actual Azure account or Uselocalstorage = true



You can try configuring the webserver to fetch from anywhere in the root of the document which I believe is in /devstoreaccount/

, the file is located and returns it when requested /crossdomain.xml


Or you could symbolize /devstoreaccount/crossdomain.xml


. And it won't break your code if somehow it was linked to/devstoreaccount/crossdomain.xml.



All Articles