         private static const LOADING_STALLED : int = 3;
         private static const LOADING_FRAGMENT_IO_ERROR : int = 4;
         private static const LOADING_KEY_IO_ERROR : int = 5;
+        private static const LOADING_COMPLETED : int = 6;
 
         /** Create the loader. **/
         public function FragmentLoader(hls : HLS, audioTrackController : AudioTrackController, streamBuffer : StreamBuffer) : void {

                        calling _loadfragment will also reload key */
                        _loadfragment(_frag_current);
                        _loading_state = LOADING_IN_PROGRESS;
                    }
                    break;
            }

                            _loading_state = _loadnextfragment(_level, _frag_previous);
                        }
                    }
                    break;
                case LOADING_STALLED:
                    /* next consecutive fragment not found:
                    it could happen on live playlist :
                    - if bandwidth available is lower than lowest quality needed bandwidth 
                    - after long pause */
                    CONFIG::LOGGING {
                        Log.warn("loading stalled: restart playback");
                    }
                    /* seek to force a restart of the playback session  */
                    seek(-1);
                    break;
                // if key loading failed
                case  LOADING_KEY_IO_ERROR:
