Copy link to clipboard
Copied
Hi,
I hope there is answer to my dilemma from server side stand point.
I have a video asset that is streamed from rtmp. Say, url is: rtmp://blah.domain.com/directory/anotherone/asset.flv
I need to invoke BitmapData.draw() on this asset.
There is crossdomain.xml file on http://blah.domain.com/crossdomain.xml that allows all the domains.
When is instantiate stream I write:
stream.checkPolicyFile = true;
Also I load crossdomain from http://blah.domain.com/crossdomain.xml and rtmp://blah.domain.com/crossdomain.xml
I tried all the combination of the above.
In all the cases when I try BitmapData.draw() - I am getting:
cannot access rtmp://blah.domain.com/directory/anotherone/. No policy files granted access.
at flash.display::BitmapData/draw()
So, does it mean that each final folder has to have it's own crossdomain.xml? Even though the root directory has one?
Also, it feels that requesting crossdomain.xml from rtmp would be odd.
Is there way around it?
Can anyone try to resolve my confusion please?
Thank you.
Flash Player clients are permitted to access data from streams in the directories specified in the Server-side ActionScript Client.audioSampleAccess and Client.videoSampleAccess
properties:
http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7ec3.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fcb
HTH,
Jody
Copy link to clipboard
Copied
Flash Player clients are permitted to access data from streams in the directories specified in the Server-side ActionScript Client.audioSampleAccess and Client.videoSampleAccess
properties:
http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7ec3.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fcb
HTH,
Jody
Copy link to clipboard
Copied
Jody,
Thank you very much for your reply.
To make sure I am clear on it. If videoSampleAccess is set correctly - there is no need for crossdomain.xml. Is this correct?
In other words, when Flash loads policy on the stream - it actually is looking for videoSampleAccess settings - not xml. Again, is my take correct?
Thank you very much again.
Andrei
Copy link to clipboard
Copied
Yes, that is correct!
Jody
Copy link to clipboard
Copied
Thank you very much!
Copy link to clipboard
Copied
I'm having the same problem but the solution hasn't worked for me. I've tried different values on the 'Client.videoSampleAccess' property and none have worked for me. My question is, if I really DON'T need a crosspolicy.xml file, what value do I need to use on 'videoSampleAccess' to get this to work? This is my set up:
The SWF application:
C:/.../MyVideoPlayer/bin-debug/IMVideoPlayer2.swf
The video:
C:\...\fms3\applications\MyVideoPlayer\streams\_definst_\videoData.flv
The 'main.asc' file:
C:\...\fms3\applications\MyVideoPlayer\main.asc
The entire contents of the 'main.asc' file:
application.onConnect = function(client) {
this.acceptConnection(client);
client.readAccess = "/";
client.writeAccess = "/";
client.videoSampleAccess = "streams/_definst_";
client.audioSampleAccess = "/";
}
The client-side AS3 error triggered at ' vData.draw(vid)':
private function getRTMPSnapshot():void
{
var vid:Video = new Video();
vid.attachNetStream(_netStream);
var vData:BitmapData = new BitmapData(vid.width, vid.height);
vData.draw(vid);
// Add preview image to DataModel
_previewImage = Bitmap(vData);
}
The error:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C:/.../MyVideoPlayer/bin-debug/IMVideoPlayer2.swf cannot access rtmp://localhost/MyVideoPlayer/. No policy files granted access.
at flash.display::BitmapData/draw()
Copy link to clipboard
Copied
Ok I have the same problem ...
I can do progressive download from http://my.sub.domain.com, but I can´t with rtmp://my.sub.domaim.com ... although I load policy files from there
(same file)
Is there a special syntax for RTMP?
I have crossdomain files on my "http" and "rtmp" server but the solution proposed here does not work at all ...
setting NetStream.videoSampleAccess to true just throws an exception telling me that there was a problem with the NetConnection ... even if I set up the stream after receiving "NetConnection.Connect.Success" ... I don´t want to sound grumpy but this is seriously irritating ... and IMHO this should be fixed
Adobe Flash Player team should also provide a comprehensive guide to the security sandbox instead of the "articles" that have been published years ago and that do not cover this specific case,
If anyone has a solution I´d be pleased, because this is one of Flash Player´s less documented features (boo)
Thanks in advance
Copy link to clipboard
Copied
Here's a simple example that works for me.
FMS application:
rootinstall/applications/streamdata
The main.asc file allows access to all streams in all subdirectories of streamdata/streams:
application.onConnect = function(client)
{
application.acceptConnection(client);
client.videoSampleAccess = "/";
}
Here's the code snipped from the FLA file (let me know if you need the connection logic, too):
var bmp:BitmapData = new BitmapData(240, 210);
bmp.draw(myVideo);
myVideo.attachNetStream(ns);
var bm:Bitmap = new Bitmap(bmp);
bm.x = 360;
bm.y = 150;
stage.addChild(bm);
No crossdomain.xml file is necessary to grab BitmapData from an RTMP stream. Access permission is set in the main.asc file.
Hope that helps,
Jody