Posted By

kungpoo on 01/28/09


Tagged

video as3 netstream


Versions (?)

Who likes this?

15 people have marked this snippet as a favorite

Hirmine
nreliu
enajenkins
themill
joergp
johnwun
iamgowan
TrentSkunk
motionmediasolutions
djmaddy
tspitzr
adrianparr
mitien
dubogii
redconservatory


AS3 Video Skeleton


 / Published in: ActionScript 3
 

  1. var video:Video = new Video(320, 240);
  2. addChild(video);
  3.  
  4. var nc:NetConnection = new NetConnection();
  5. nc.connect(null);
  6.  
  7. var ns:NetStream = new NetStream(nc);
  8. ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
  9.  
  10. function onStatusEvent(stat:Object):void
  11. {
  12. trace(stat.info.code);
  13. }
  14.  
  15. var meta:Object = new Object();
  16. meta.onMetaData = function(meta:Object)
  17. {
  18. trace(meta.duration);
  19. }
  20.  
  21. ns.client = meta;
  22.  
  23. video.attachNetStream(ns);
  24.  
  25. ns.play("VIDEO");

Report this snippet  

You need to login to post a comment.