     }
 
     public func skipToNextTrack() {
-        let nextIndex: Int = currentIndex + 1
+        let isLastTrack: Bool = currentIndex == lastTrackIndex()
+        let nextIndex: Int    = isLastTrack ? 0 : currentIndex + 1
 
-        if isValidIndex(nextIndex) {
+        switch playMode {
+        case .RepeatPlayList:
             setCurrentIndex(nextIndex)
-            player.play()
-            return
+            play()
+        case .RepeatItem:
+            seekToTrackBeginning()
+        case .NoRepeat:
+            setCurrentIndex(nextIndex)
+            if isLastTrack {
+                pause()
+            }
         }
-
-        player.pause()
-        seekToTrackBeginning()
     }
 
     public func beginRewinding() {

    }

    private func isValidIndex(index: Int) -> Bool {
        return 0 <= index && index <= playListURLs.count - 1
    }

    private func resetPlayerRate() {

import AVFoundation

public class PlayListPlayer: PlayListPlayerType {

    //MARK: - public properties

    public static let sharedInstance: PlayListPlayer = PlayListPlayer()

    public var didFinishPlayingTrack:(() -> Void)?
    public var didFinishPlayingPlayList:(() -> Void)?

    public var playMode: PlayMode = .RepeatPlayList

    //MARK: - private properties

    private let player: AVPlayer = AVPlayer()

    private(set) var playListURLs: [NSURL] = []
    private(set) var currentIndex: Int     = 0


    //MARK: - update PlayListPlayer properties

