i am loading and playing a local video file with appendBytes() and when i call a bitmapData.draw() function
below exception comes up.
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw
cannot access null. No policy files granted access.
what should i do???....
if the swf is local to the loaded file, change your security settings: http://www.macromedia.com/support/documentation/en/flashplayer/help/se ttings_manager04.html
if it's not, then you can use a server gateway file
i did what you said but no luck.. my videos and my swf is on a same server is i still need to change my gateway file???
this is my crossdomain.xml i allow access from all domain
<cross-domain-policy>
<allow-access-from domain="*"/>
<allow-access-from domain="182.50.154.181"/>
</cross-domain-policy>
http://182.50.154.181/crossdomain.xml
this is my swf page
http://182.50.154.181/dancesportexperts/videoeditor/flash_page.php?id= 52
may be i am doing some thing wrong plz guide me on this thing???....
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.OPEN, fileLoaderOpen);
urlLoader.addEventListener(StatusEvent.STATUS,onStatus);
urlLoader.addEventListener(ProgressEvent.PROGRESS, fileLoaderProgress);
urlLoader.addEventListener(Event.COMPLETE,fileLoaderComplete);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.load(new URLRequest("http://182.50.154.181/dancesportexperts/user_data/uploads/cd7350282845 7d15655bbd7a63fb0bc8/v/1345023450-Action_.flv"));
i also try this
urlStream.load(new URLRequest("test_videos/Diving.flv"));
private function fileLoaderComplete(event:Event):void
{
//Pass the loaded bytes to player
player.AddVideo(urlLoader.data);
}
private function captureFrame():void
{
// capture frame
var b:BitmapData = new BitmapData(player.width,player.height,false,0x0);
b.draw(player);
_bitmaps.push(b);
}
i also test my application on another server.
i test with both absolute and relative paths
i try to load a file with UrlStream but same error also.
let me khow if u want to view my full Source Code i can sent it to you by email.
ok, back to my first message: use a relative (not absolute) path to your video file.
that's an absolute url. use something like:
urlLoader.load(new URLRequest("../user_data/uploads/cd7350282845 7d15655bbd7a63fb0bc8/v/1345023450-Action_.flv"));
Sir i already mention in my last message i test it with both relative and absolute.
Yes i khow relative paths works fine when i do some thing like this
<mx:VideoDisplay x="0" y="0" width="516" height="379" source="../user_data/uploads/cd73502828457d15655bbd7a63fb0bc8/v/13450 23450-Action_.flv"/>
bitmap.draw works fine in above case but my scenario is different i am loading a complete video as bytearray before playing and play video from that bytes
private function fileLoaderComplete(event:Event):void
{
//Pass the loaded bytes to player
player.AddVideo(urlLoader.data);
}
//This is Add video Function in Player.mxml
public function AddVideo(VideobyteArray:ByteArray):void
{
if(ns == null)
{
var nc:NetConnection = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
// ns.checkPolicyFile = true;
ns.soundTransform = new SoundTransform(0.0);
ns.client = this;
ns.addEventListener(NetStatusEvent.NET_STATUS, nsStatus);
}
videoData = VideobyteArray;
GetTags(videoData);
ns.play(null);
ns.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
ns.appendBytes(VideobyteArray);
video.attachNetStream(ns);
playBar.TogglePlay(true);
}
i think its a bug in flash sdk 4.6 (Flash Player 11)
bitmap.draw function somehow conflicts with the appendBytesAction or appendBytes
this question is posted on ActionScript 3.0 forum before
http://forums.adobe.com/message/4650890#4650890
http://flash.bigresource.com/flash-use-BitmapData-draw-with-NetStream- appendBytes--iTNz6LVJM.html
http://stackoverflow.com/questions/5607047/how-can-i-use-bitmapdata-dr aw-with-netstream-appendbytes
North America
Europe, Middle East and Africa
Asia Pacific