     import flash.net.NetStream;
     
     import org.mangui.hls.HLS;
+    import org.mangui.hls.HLSEvent;
     import org.mangui.osmf.plugins.loader.HLSNetLoader;
     import org.mangui.osmf.plugins.traits.*;
+    import org.mangui.osmf.plugins.utils.ErrorManager;
     
     import org.osmf.media.LoadableElementBase;
     import org.osmf.media.MediaElement;

            _hls = hls;
            _defaultduration = duration;
            super(resource, new HLSNetLoader(hls));
        }

        protected function createVideo() : Video {

            var alternateAudioTrait : HLSAlternativeAudioTrait = new HLSAlternativeAudioTrait(_hls, this as MediaElement);
            addTrait(MediaTraitType.ALTERNATIVE_AUDIO, alternateAudioTrait);
        }

        private function _errorHandler(event : HLSEvent) : void {
            var errorCode : int = ErrorManager.getMediaErrorCode(event);
            var errorMsg : String = ErrorManager.getMediaErrorMessage(event);
            CONFIG::LOGGING {
            Log.warn("HLS Error event received, dispatching MediaError " + errorCode + "," + errorMsg);
            }
            dispatchEvent(new MediaErrorEvent(MediaErrorEvent.MEDIA_ERROR, false, false, new MediaError(errorCode, errorMsg)));
        }
    }
}
