Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat mode settings #14

Open
Shishani58 opened this issue Jul 22, 2020 · 1 comment
Open

Repeat mode settings #14

Shishani58 opened this issue Jul 22, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Shishani58
Copy link

Thanks so much for such a nice library.
Is it possible to do something like numberOfLoops from AVAudioPlayer? For both modes — repeatOne and repeatAll?

@yoheimuta
Copy link
Owner

@Shishani58 Sorry for the late replay.
It looks hard to do something like numberOfLoops at the moment.
To support this, RxMusicPlayer should implement the numberOfLoops for repeatOne, like the below.

diff --git a/RxMusicPlayer/RxMusicPlayer.swift b/RxMusicPlayer/RxMusicPlayer.swift
index c0dc8ce..6ce6f2b 100644
--- a/RxMusicPlayer/RxMusicPlayer.swift
+++ b/RxMusicPlayer/RxMusicPlayer.swift
@@ -87,7 +87,7 @@ open class RxMusicPlayer: NSObject {
      */
     public enum RepeatMode: Equatable {
         case none
-        case one
+        case one(numberOfLoops: Int)
         case all
     }

If you like it, I can accept your PR. Or I try to implement It when I have time.

@yoheimuta yoheimuta added enhancement New feature or request good first issue Good for newcomers labels Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants