actionscript 3 - show dimension of flv in text field -


below basic code, im loading flv video using flvplayback.

i need features of flvplayback compulsorily.

i have finished loading flv video sucessfully.

now im stuckup showing source video files original dimension in text field.

how should proceed further here. please guide me......

stage.displaystate = stagedisplaystate.full_screen; stage.align = stagealign.top_left; stage.scalemode = stagescalemode.no_scale;  import fl.video.*;  stop();  var rmys01:flvplayback = new flvplayback(); rmys01.source = "rhym01.flv"; rmys01.skin = "minimaflatcustomcolorplaybackseekcountervolmute.swf"; rmys01.autoplay = true; rmys01.fullscreentakeover = false; rmys01.scalemode = "maintainaspectratio"; rmys01.setsize((stage.stagewidth/1.03), (stage.stageheight/1.03)); rmys01.x = (stage.stagewidth/2)  - (rmys01.width/2); rmys01.y = (stage.stageheight/1.1) - (rmys01.height/1.1); addchild(rmys01); setchildindex(rmys01,1); 

did set client netstream? because, work ok.

here example:

var nc:netconnection = new netconnection(); nc.connect(null);  var ns:netstream = new netstream(nc); var client: object = {}; client.onmetadata = function(data:object):void{     //display width , height     var textfield: textfield = new textfield();     textfield.autosize = textfieldautosize.left;     textfield.defaulttextformat = new textformat("arial", 28);     textfield.text = "width: " + data.width + ", height: " + data.height;     addchild(textfield); } ns.client = client; ns.play("path/to/video");  var myvideo:video = new video(); myvideo.attachnetstream(ns); addchild(myvideo); 

for debugging purposes place trace (trace("there metadata!");) onmetadata handler, check, if triggers.

for flvplayback, should subscribe videoevent.ready:

rmys01.addeventlistener(videoevent.ready, onready);  function onready(e:videoevent):void {     trace("ready");     var flvplayback:flvplayback = e.target flvplayback;     var metadata:object = flvplayback.metadata object;     trace("height: "+metadata.height);     trace("width: "+metadata.width);     trace("duration: "+metadata.duration); } 

if coding in flash ide, there problem videoevent, should use qualified class (fl.video.videoevent), if not, ide try resolve flash.events.videoevent:

rmys01.addeventlistener(fl.video.videoevent.ready, onready);  function onready(e:fl.video.videoevent):void {     //handler code } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -