             return levels;
         }
 
+        private static function hola_hls_get_current_fragment(): String
+        {
+            return _currentFrag;
+        }
+
         private static function hola_hls_get_levels_async(): void
-	{
-	    setTimeout(function(): void
-	    {
+        {
+            setTimeout(function(): void
+            {
                 var levels: Array = [];
                 for (var i: int = 0; i<_hls.levels.length; i++)
                     levels.push(level_to_object(_hls.levels[i]));
-		JSAPI.postMessage('flashls.hlsAsyncMessage', {type: 'get_levels', msg: levels});
-	    }, 0);
-        }	
-
-        private static function hola_hls_get_segment_info(url:String):Object{
-            for (var i:int = 0; i<_hls.levels.length; i++)
+                JSAPI.postMessage('flashls.hlsAsyncMessage', {type: 'get_levels', msg: levels});
+            }, 0);
+        }
+
+        private static function hola_hls_get_segment_info(url: String): Object
+        {
+            for (var i: int = 0; i<_hls.levels.length; i++)
             {
-                var l:Level = _hls.levels[i];
+                var l: Level = _hls.levels[i];
                 for (var j:int = 0; j<l.fragments.length; j++)
                 {
                     if (url==l.fragments[j].url)

                hola_hls_get_buffer_sec);
            ExternalInterface.addCallback("hola_hls_get_state",
                hola_hls_get_state);
            ExternalInterface.addCallback("hola_hls_get_levels",
                hola_hls_get_levels);
	    ExternalInterface.addCallback("hola_hls_get_levels_async",
	        hola_hls_get_levels_async);
            ExternalInterface.addCallback("hola_hls_get_segment_info",
                hola_hls_get_segment_info);
            ExternalInterface.addCallback("hola_hls_get_level",
                hola_hls_get_level);
	    ExternalInterface.addCallback("hola_hls_get_bitrate",
	        hola_hls_get_bitrate);
	    ExternalInterface.addCallback("hola_hls_get_decoded_frames",
	        hola_hls_get_decoded_frames);
            ExternalInterface.addCallback("hola_setBandwidth",
                hola_setBandwidth);
            ExternalInterface.addCallback("hola_hls_setBandwidth",


    public class HLSJS
    {
        private static var _inited: Boolean = false;
        private static var _duration: Number;
        private static var _bandwidth: Number = -1;
        private static var _url: String;
        private static var _currentFrag: String;
        private static var _state: String;
        private static var _hls: HLS;
        private static var _silence: Boolean = false;

        public static function init():void{
            if (_inited || !ZExternalInterface.avail())
