Closed anderflash closed 12 years ago
Hi,
Yes, I have never tried this feature indeed :-) So possible that it doesn't work, contact me at the address: cumulus.dev@gmail.com, to see it together.
I was using Cumulus with Away3D. I've put the remote NetStream in a StageVideo, behind Away3D with transparent background. So I have seen remote webcam as a background for Away3D. But the new release of FP11 doesn't allow transparent background. Away3D let me use a backgroundImage property, but it needs pixel-level access. When I use this strategy, it gives me an Error #2123 (Security Violation). That's why I write this post. The NetStream has a checkPolicyFile property. If set to true, it looks for a crossdomain.xml file to get the permission. I think the solution can be an answer for crossdomain request. If I use rtmfp://localhost as a server, I think it looks for an rtmfp://localhost/crossdomain.xml.
See the description for checkPolicyFile:
flash.net.NetStream.checkPolicyFile(state:Boolean):void
Specifies whether the application tries to download a cross-domain policy file from the loaded video file's server before beginning to load the video file. Use this property for progressive video download, and to load files that are outside the calling SWF file's own domain. This property is ignored when you are using RTMP. Set this property to true to call BitmapData.draw() on a video file loaded from a domain outside that of the calling SWF. The BitmapData.draw() method provides pixel-level access to the video. If you call BitmapData.draw() without setting the checkPolicyFile property to true at loading time, you can get a SecurityError exception because the required policy file was not downloaded. Do not set this property to true unless you want pixel-level access to the video you are loading. Checking for a policy file consumes network bandwidth and can delay the start of your download. When you call the NetStream.play() method with checkPolicyFile set to true, Flash Player or the AIR runtime must either successfully download a relevant cross-domain policy file or determine that no such policy file exists before it begins downloading. To verify the existence of a policy file, Flash Player or the AIR runtime performs the following actions, in this order:
I don't know if it helps, but try to see if the Cumulus Server receives an
But it's not working.
I think I found a solution.
On the publisher client:
On the receiver client:
Well. To save bandwidth, the receiver can send to the publisher a message to stop the timer (for example, using a NetGroup.post).
The simple demo here worked (the bitmap showed the remote webcam). I will try on my project (as a background for Away3D) to see if it can be a solution. Thanks
It exists a clean way, but here, in your case, publisher publishs to Cumulus? or between peers? It's a publisher->Cumulus->subscriber case? or publisher->subscriber (in P2P) ?
I have just added two new options: videoSampleAccess and audioSampleAccess (see readme file), but it works only for publication not in P2P (with Cumulus intermediate).
I think ns.send("|RtmpSampleAccess",true,true) will send directly to the subscriber. After the subscriber start playing the publisher stream, he asks for permission. So the publisher sends this property, until the subscriber receives it.
As I have some code in Java, I'm using (in fact, learning) Red5 as Database Server, and Cumulus as P2P Server. It's a very interesting world I'm learning.
Ok, I see, so it's in P2P, it means that the property "videoSampleAccess" of "NetStream" doesn't work, and Michael Thornburgh seems confirming it on this post: http://forums.adobe.com/thread/632355?decorator=print&displayFullThread=true So... the trick "ns.send("|RtmpSampleAccess",true,true)" is the good way today...
I need to draw a BitmapData from a Video which has a Cumulus NetStream attached in. The problem is: Cumulus is not allowing to have pixel level access.
What is the configuration to have this permission?
Thanks.