                 // if key loading failed
                 case  LOADING_KEY_IO_ERROR:
                     // compare current date and next retry date.
-                    if (new Date().valueOf() >= _key_load_error_date) {
+                    if (getTimer() >= _key_load_error_date) {
                         /* try to reload the key ...
                         calling _loadfragment will also reload key */
                         _loadfragment(_frag_current);


            if (fragData.decryptAES) {
                var fragMetrics : FragmentMetrics = _frag_current.metrics;
                fragMetrics.decryption_end_time = new Date().valueOf();
                var decrypt_duration : Number = fragMetrics.decryption_end_time - fragMetrics.decryption_begin_time;
                CONFIG::LOGGING {
                    Log.debug("Decrypted     duration/length/speed:" + decrypt_duration + "/" + fragData.bytesLoaded + "/" + ((8000 * fragData.bytesLoaded / decrypt_duration) / 1024).toFixed(0) + " kb/s");

            }
            if (HLSSettings.fragmentLoadMaxRetry == -1 || _frag_retry_count < HLSSettings.fragmentLoadMaxRetry) {
                _loading_state = LOADING_FRAGMENT_IO_ERROR;
                _frag_load_error_date = getTimer() + _frag_retry_timeout;
                CONFIG::LOGGING {
                    Log.warn("retry fragment load in " + _frag_retry_timeout + " ms, count=" + _frag_retry_count);
                }
