Embedded FLV
i have short video of 90 seconds i'd embed in swf file. reason as3 code can't find video. need use bitmapdata.draw method take still shots of flv simulate webcam if users don't have webcam. don't want use components because code takes bitmapdata.draw video class instance i'd use same methods i'm using webcam. tried putting flv on remote server , worked except bitmapdata.draw kept coming security violations appear bug. i'd rather have flv embedded anyway since short in length , not on timeline can access directly in action script.
i imported flv file , in library see flv it's auto-generated movieclip. in output get: net stat: netstream.play.streamnotfound
all of forums i've researched talk flv , flv component players, none simple except lee brimelow's site. it's simple fix.
import flash.display.sprite;
import flash.events.netstatusevent;
import flash.events.securityerrorevent;
import flash.media.video;
import flash.net.netconnection;
import flash.net.netstream;
import flash.events.event;
var my_video:video = new video(720,1080); //the video taller wider
addchild(my_video);
var nc:netconnection = new netconnection();
nc.connect(null);
var ns:netstream = new netstream(nc);
my_video.attachnetstream(ns);
//ns.play("http://www.postureviewer.com/video4a"); //this works , video still @ location.
//ns.play("video4a.flv"); //doesn't work
ns.play("video4a"); //doesn't work
var netclient:object = new object();
netclient.onmetadata = function(meta:object)
{
trace("meta duration: "+meta.duration);
};
ns.client = netclient;
ns.addeventlistener(netstatusevent.net_status, netstat);
function netstat(stats:netstatusevent)
{
trace("net stat: "+stats.info.code);
};
put flv on same server flash app , use local path flv.
More discussions in ActionScript 3
adobe
Comments
Post a Comment