I
I
iFrolov2012-06-08 01:26:33
Apache Flex
iFrolov, 2012-06-08 01:26:33

Flash: Accessing an audio stream on a foreign domain, without crossdomain.xml?

All my life I thought that the subject is impossible. What I must say, it scared away many customers, until they poked my nose into an example: dump.bitcheese.net/files/yhacewe/playtest.swf

There is no SoundLoaderContext inside, there are no crossdomain.xml, but it plays. Checked on different domains - works. Question - how does it work? What kind of technology is indistinguishable from magic?
var s:Sound=new Sound(new URLRequest("http://sanfm.ru:8000/live"));
s.play();


Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Clark Kent, 2012-06-08
@FlashManiac

It's simple, it's a stream. The first request is supposed to be <policy-file-request/> . The server responds to this with this hop, and then the sound stream is broadcast. So, for example, the socket server works, maybe it's the same here.
Also, don't underestimate crossdomain.xml. But it is necessary for the security of the application and content.

I
iFrolov, 2012-06-09
@iFrolov

For the client, in this case, there is no difference whether the stream is there or a static file. If you are hinting at Socket Policy www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html , then I will disappoint you 3 times:
1. there is no new Socket() anywhere in the player code;
2. you can knock on port 843 yourself, get Connection refused
3. the broadcast server does not know anything about the policy-file-request, I say exactly, and not “maybe”, as a person with extensive experience in various streaming.
I didn’t understand anything about underestimation, because in this case it simply doesn’t exist. Or will you show it?
What is unpleasant is the same trick, but it no longer works with RTMP. Rather, it works on its own domain, although the documentation is even more interesting:
In addition, this method cannot be used to extract data from RTMP streams, even when it is called by content that reside in the same domain as the RTMP server.
Everything is more and more wonderful.

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question