         }
     }
 
-    internal var currentVideoPlaybackEnded: Bool = false
-    
-    /**
-        Indicates the elapsed playback time of the current playing item.
-        - Note: The playbackPosition is a relative value.
-        It's calculated in consideration of the startPosition and endPosition properties.
+    /**
+     Indicates the elapsed playback time of the current playing item.
+     - Note: The playbackPosition is a relative value.
+     It's calculated in consideration of the startPosition and endPosition properties.
      */
     public var playbackPosition: Float? {
         

        currentVideoPlaybackEnded = false
    }

    internal func playerItemDidPlayToEndTime(_ notification: Notification? = nil) {
        
        if player.rate != 0.0 {
            
            player.rate = 0.0
        }

        updatePlaybackState(.finished)
        
        delegate?.playerHasFinishedPlayingVideo(self)
    }

    internal func playerItemPlaybackStalled(_ notification: Notification) {

            delegate?.player(self, didUpdatePlaybackPosition: position, playbackProgress: progress)
            
            /* Set the current video to be completed if it matches the 'endPosition' tag.*/
            if position >= self.endPosition - self.startPosition {
                
                self.playerItemDidPlayToEndTime(nil)
            }
        }
    }
