Guest User

Untitled

a guest
Jun 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FLVPlayer.hx:
  2.  
  3. import flash.display.Sprite;
  4. import flash.net.NetConnection;
  5. import flash.net.NetStream;
  6. import flash.media.Video;
  7.  
  8. class FLVPlayer extends Sprite
  9. {
  10.     private var nc:NetConnection;
  11.     private var ns:NetStream;
  12.     private var video:Video
  13.  
  14.     public function new()
  15.     {  
  16.         super();
  17.         nc = new NetConnection();
  18.         nc.connect(null);
  19.        
  20.         ns = new NetStream(nc);    
  21.         ns.play("flash.flv");
  22.        
  23.         video = new Video();
  24.         video.attachNetStream(ns);
  25.         addChild(video);
  26.     }
  27.  
  28.     static function main()
  29.     {
  30.         var p = new FLVPlayer();
  31.         flash.Lib.current.addChild(p);
  32.     }
  33. }
  34.  
  35. compile.hxml:
  36.  
  37. -swf9 flvplayer.swf
  38. -main FLVPlayer
Add Comment
Please, Sign In to add comment