Skip to content

Commit

Permalink
QueuedAudioPlayer: emit event.playbackEnd.emit events after their sub…
Browse files Browse the repository at this point in the history
…ject has ocurred (see doublesymmetry#14)
  • Loading branch information
puckey committed Sep 14, 2022
1 parent ea7f4d4 commit 427adeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SwiftAudioEx/Classes/QueuedAudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ public class QueuedAudioPlayer: AudioPlayer, QueueManagerDelegate {
- throws: `APError`
*/
public func next() {
event.playbackEnd.emit(data: .skippedToNext)
_ = queue.next(wrap: repeatMode == .queue)
event.playbackEnd.emit(data: .skippedToNext)
}

/**
Step to the previous item in the queue.
*/
public func previous() {
event.playbackEnd.emit(data: .skippedToPrevious)
_ = queue.previous(wrap: repeatMode == .queue)
event.playbackEnd.emit(data: .skippedToPrevious)
}

/**
Expand All @@ -138,8 +138,8 @@ public class QueuedAudioPlayer: AudioPlayer, QueueManagerDelegate {
if (index == currentIndex) {
seek(to: 0)
} else {
event.playbackEnd.emit(data: .jumpedToIndex)
_ = try queue.jump(to: index)
event.playbackEnd.emit(data: .jumpedToIndex)
}
}

Expand Down

0 comments on commit 427adeb

Please sign in to comment.