   import flash.net.NetStream;
   import flash.net.URLRequest;
   import flash.system.Security;
-  import flash.text.TextField;
 
   public class Player extends Sprite {
 
     private var posterUrl: String;
     private var videoUrl: String;
+    private var loop: Boolean;
     private var muted: Boolean;
-    private var autoPlay: Boolean;
+    private var autoplay: Boolean;
 
     private var videoPlaying: Boolean;
 

      video = new Video(stage.stageWidth, stage.stageHeight);
      addChild(video);

      //posterContainer.visible = false;

      stream = new NetStream(connection);
      stream.soundTransform = new SoundTransform(muted ? 0 : 1);
      stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
      video.attachNetStream(stream);

      stream.play(videoUrl);
      if (!autoPlay) pause();
    }

  }

    private function netStatusHandler(event: NetStatusEvent): void {
      switch (event.info.code) {
        case "NetConnection.Connect.Success": connectStream(); break;
        case "NetStream.Play.Stop": if (loop) stream.seek(0); break;
      }
    }

