         };
 
         private function _manifestHandler(event : HLSEvent) : void {
+            _duration = event.levels[0].duration;
             if (ExternalInterface.available) {
                 ExternalInterface.call("onManifest", event.levels[0].duration);
             }

            ExternalInterface.addCallback("getLevel", _getLevel);
            ExternalInterface.addCallback("getLevels", _getLevels);
            ExternalInterface.addCallback("getMetrics", _getMetrics);
            ExternalInterface.addCallback("getPosition", _getPosition);
            ExternalInterface.addCallback("getState", _getState);
            ExternalInterface.addCallback("getType", _getType);

            return _hls.metrics;
        };

        private function _getDuration() : Number {
          return _duration;
        };

        private function _getPosition() : Number {
            return _hls.position;
        };
