Link in Zwischenablage kopieren
Kopiert
Hello!
I've on my flash-page some music and i'm using an eq-visualizer. this is works fine with the enter_frame - event.
I've also an video-stream, it work's fine, too.
But if i stream a video, the eq-visualizer doesn't work anymore in the browser. It is flimmering sometimes, so i think there is a problem with streaming and enter_frame ... when i write in the code with flash and press "test-movie" (apple + return), it works - the eq-visualizer shows the music-waves of the video. But not in the browser. When the video is finish or "stop" is pressed, the eq-visualizer works as befor.
So where i've made a mistake?
This is the example-page http://mutti.lima-city.de/test/nin_remix.html - the videos are in the left box.
Thanks for help, sorry for my english.
edit - I'm using flash cs3 and as3
You got it backwards. Policy must specify domains that will SEND request to the domain where assets are hosted. So, you policy file should be:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="mutti.lima-city.de" />
</cross-domain-policy>
Also, note that you shouldn't include protocol or forward slashes.
Link in Zwischenablage kopieren
Kopiert
You need to use debug player.
You thing throws an error:
SecurityError: Error #2122: Security sandbox violation: SoundMixer.computeSpectrum: http://mutti.lima-city.de/test/nin_remix.swf cannot access http://download.sonok.lima-city.de/krimskrams/0002_0485.flv. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.media::SoundMixer$/computeSpectrum()
at scripte.sonok_30::Start/fadeCircle()
This means you need to tell your stream to load policy File. Here is documentation:
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html#checkPolicyFile
By the way, if the video is on a third party domain and they restrict access - you may not be able to compute spectrum.
Link in Zwischenablage kopieren
Kopiert
Thank you - now i have one (i was thinking i had one bevore) and i see the error.
I've insert
ns.checkPolicyFile = true;
and now i get a new error -> SecurityError: Error #2123: Security sandbox ...
But i don't know how i get a policy file.
The webspace i use is some dual-think - it is free webspace (for the swf, for example), but for some download-stuff (like the videos) i've to pay, and it's on another domain. But i'me able to load up and down the files there as i want.
So, if i'me able to create a police file (like a text-file or a .htaccess-file), i can do this, i think ... or is it some kind of the server-spezification? there i can't do anything ...
Link in Zwischenablage kopieren
Kopiert
Yes, you need to create a policy file (which is xml) on the server where video assets are hosted. It will be loaded automatically by Flash when loadPolicyFile is set to true.
Link in Zwischenablage kopieren
Kopiert
a file called
crossdomain.xml
with
<?xml version="1.0"?> <cross-domain-policy> <allow-access-from domain="http://mutti.lima-city.de/test/" />
</cross-domain-policy>
where my videos are? and <allow-access-from domain="http://mutti.lima-city.de/test/" /> is where my *.swf is?
Link in Zwischenablage kopieren
Kopiert
No, where your videos are.
Link in Zwischenablage kopieren
Kopiert
hm, something i made wrong ...
my videos are here:
http://download.sonok.lima-city.de/krimskrams/
my crossdomain.xml ist here, too:
http://download.sonok.lima-city.de/krimskrams/
in the crossdomain.xml i write:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="download.sonok.lima-city.de" />
<allow-access-from domain="download.sonok.lima-city.de/krimskrams/" />
</cross-domain-policy>
and in the swf-file i write:
client = new Object;
client.onMetaData = metadataHandler;
nc = new NetConnection;
nc.connect(null);
ns = new NetStream(nc);
ns.checkPolicyFile = true;
ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
ns.client=client;
ns.play(url);
Link in Zwischenablage kopieren
Kopiert
Try to place you policy file into the root so it reads:
http://download.sonok.lima-city.de/crossdomain.xml
Otherwise, I think, you will need to use Security.loadPolicyFile("http://download.sonok.lima-city.de/krimskrams/crossdomain.xml") in the beginning of the application.
Link in Zwischenablage kopieren
Kopiert
Hm, now i've the xml in http://download.sonok.lima-city.de/crossdomain.xml, in http://download.sonok.lima-city.de/krimskrams/crossdomain.xml and i use the Security.loadPolicyFile - option, but it still not work. Do i've to do anything else then put the Security.loadPolicyFile - line in the code?
I've ask one of the team there, http://download.sonok.lima-city.de/ is the root he says. Hm. Now i've go to work, thank you for your help so far. I will try it in the evening again.
Link in Zwischenablage kopieren
Kopiert
Now i tried it sometimes, but it doesn't work yet. I've testet it with
Security.loadPolicyFile("http://download.sonok.lima-city.de/crossdomain.xml"); and
Security.loadPolicyFile("http://download.sonok.lima-city.de/krimskrams/crossdomain.xml");
I have the same xml in
http://download.sonok.lima-city.de/krimskrams/crossdomain.xml and in
http://download.sonok.lima-city.de/crossdomain.xml
I've testet it with
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="download.sonok.lima-city.de/krimskrams/" />
<allow-access-from domain="download.sonok.lima-city.de/" />
</cross-domain-policy>
and with
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="http://download.sonok.lima-city.de/krimskrams/" />
<allow-access-from domain="http://download.sonok.lima-city.de/" />
</cross-domain-policy>
I really don't know what i can do now.
Link in Zwischenablage kopieren
Kopiert
You got it backwards. Policy must specify domains that will SEND request to the domain where assets are hosted. So, you policy file should be:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="mutti.lima-city.de" />
</cross-domain-policy>
Also, note that you shouldn't include protocol or forward slashes.
Link in Zwischenablage kopieren
Kopiert
Yes, great, thank you, now it works.
Thank you very much for your time!
Link in Zwischenablage kopieren
Kopiert
You are welcome.