Posted By

lzyy on 10/15/08


Tagged

flv player


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dubogii


最基本的flv播放器


 / Published in: ActionScript 3
 

  1. var nc:NetConnection = new NetConnection();
  2. nc.connect(null);
  3.  
  4. var ns:NetStream = new NetStream(nc);
  5.  
  6. var vid:Video = new Video(320, 240);
  7. this.addChild(vid);
  8.  
  9. vid.attachNetStream(ns);
  10.  
  11. ns.play("http://www.linkmobile.net/yf/Wanted_T4.flv");
  12.  
  13. ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
  14.  
  15. function netstat(stats:NetStatusEvent)
  16. {
  17. //trace(stats.info.code);
  18. }
  19.  
  20. var netClient:Object = new Object();
  21. netClient.onMetaData = function(meta:Object)
  22. {
  23. trace(meta.width);
  24. };
  25.  
  26. ns.client = netClient;

Report this snippet  

You need to login to post a comment.