   import flash.display.Sprite;
   import flash.external.ExternalInterface;
   import flash.system.Security;
+  import flash.net.NetStream;
+  import flash.events.*;
 
   import org.osmf.containers.MediaContainer;
   import org.osmf.elements.VideoElement;
+  import org.osmf.net.NetStreamLoadTrait;
+
   import org.osmf.media.DefaultMediaFactory;
   import org.osmf.media.MediaElement;
   import org.osmf.media.MediaPlayer;
   import org.osmf.media.URLResource;
+
   import org.osmf.events.TimeEvent;
+  import org.osmf.events.BufferEvent;
+  import org.osmf.events.MediaElementEvent;
+  import org.osmf.events.LoadEvent;
+
+  import org.osmf.traits.MediaTraitType;
 
   [SWF(width="640", height="360")]
   public class RTMP extends Sprite {

      playbackId = this.root.loaderInfo.parameters.playbackId;
      mediaFactory = new DefaultMediaFactory();
      mediaContainer = new MediaContainer();

      setupCallbacks();
      ExternalInterface.call('console.log', 'clappr rtmp 0.2-alpha');
      _triggerEvent('flashready');
    }


    private function _triggerEvent(name: String):void {
      ExternalInterface.call('Clappr.Mediator.trigger("' + playbackId + ':' + name +'")');
    }

    private function getState():String {
      return playbackState;
    }
  }
}
