                 reachedEnd : Boolean = _streamBuffer.reachedEnd,
                 liveLoadingStalled : Boolean = _streamBuffer.liveLoadingStalled;
             // Log.info("netstream/total:" + super.bufferLength + "/" + this.bufferLength);
-            // Set playback state. no need to check buffer status if seeking
+
             if (_seekState != HLSSeekStates.SEEKING) {
-                // check low buffer condition
-                if (buffer <= 0.1) {
-                    if (reachedEnd || liveLoadingStalled) {
-                        // Last tag done? Then append sequence end.
+                if (_playbackState == HLSPlayStates.PLAYING) {
+                  /* check if play head reached end of stream.
+                        this happens when
+                            playstate is PLAYING
+                        AND last fragment has been loaded,
+                            either because we reached end of VOD or because live loading stalled ...
+                        AND NetStream is almost empty(less than 2s ... this is just for safety ...)
+                        AND StreamBuffer is empty(it means that last fragment tags have been appended in NetStream)
+                        AND playhead is not moving anymore (NetStream.time not changing overtime)
+                    */
+                    if((reachedEnd || liveLoadingStalled) &&
+                       bufferLength <= 2 &&
+                       _streamBuffer.bufferLength == 0 &&
+                       _lastNetStreamTime &&
+                       super.time == _lastNetStreamTime) {
+                        // playhead is not moving anymore ... append sequence end.
                         super.appendBytesAction(NetStreamAppendBytesAction.END_SEQUENCE);
                         super.appendBytes(new ByteArray());
-                        // reach end of playlist + playback complete (as buffer is empty).
-                        // stop timer, report event and switch to IDLE mode.
+                        // have we reached end of playlist ?
                         if(reachedEnd) {
+                            // stop timer, report event and switch to IDLE mode.
                             _timer.stop();
                             CONFIG::LOGGING {
                                 Log.debug("reached end of VOD playlist, notify playback complete");

                            _setPlaybackState(HLSPlayStates.IDLE);
                            _setSeekState(HLSSeekStates.IDLE);
                        } else {
                            // flush buffer and restart playback in case live loading stalled
                            CONFIG::LOGGING {
                                Log.warn("loading stalled: restart playback");
                            }

                Log.info("HLSNetStream:close");
            }
            super.close();
            _watchedDuration = _skippedDuration = _lastNetStreamTime = 0;
            _streamBuffer.stop();
            _timer.stop();
            _setPlaybackState(HLSPlayStates.IDLE);
