https://github.com/irons163/irmusicplayer-swift
IRMusicPlayer-swift is a powerful music player for iOS.
https://github.com/irons163/irmusicplayer-swift
ios music-player musicplayer musicplayer-online swift
Last synced: 3 months ago
JSON representation
IRMusicPlayer-swift is a powerful music player for iOS.
- Host: GitHub
- URL: https://github.com/irons163/irmusicplayer-swift
- Owner: irons163
- License: mit
- Created: 2020-09-30T10:28:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T05:58:03.000Z (over 4 years ago)
- Last Synced: 2025-07-17T12:53:46.682Z (3 months ago)
- Topics: ios, music-player, musicplayer, musicplayer-online, swift
- Language: Swift
- Homepage:
- Size: 9.76 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# IRMusicPlayer-swift
- IRMusicPlayer-swift is a powerful music player for iOS.
- The Objc version [IRMusicPlayer](https://github.com/irons163/IRMusicPlayer).## Features
- Support online/local play.
- Support to show music cover.
- Support randon mode.
- Support repeat modes: repeat all musics once, repeat current music forever, repeat all musics forever.## Future
- Support background play.## Install
### Git
- Git clone this project.
- Copy this project into your own project.
- Add the .xcodeproj into you project and link it as embed framework.
#### Options
- You can remove the `demo` and `ScreenShots` folder.### Cocoapods
- Add `pod 'IRMusicPlayer-swift'` in the `Podfile`
- `pod install`## Usage
### Basic
```swift
import IRMusicPlayer_swiftlet xibBundle: Bundle = Bundle.init(for: MusicPlayerViewController.self)
let vc: MusicPlayerViewController = MusicPlayerViewController.init(nibName: "MusicPlayerViewController", bundle: xibBundle)vc.musicListArray.add(NSDictionary.init(object: Bundle.main.path(forResource: "1", ofType: "mp3")!, forKey: "musicAddress" as NSCopying))
vc.musicListArray.add(NSDictionary.init(object: Bundle.main.path(forResource: "2", ofType: "mp3")!, forKey: "musicAddress" as NSCopying))
vc.musicListArray.add(NSDictionary.init(object: Bundle.main.path(forResource: "3", ofType: "mp3")!, forKey: "musicAddress" as NSCopying))
vc.modalPresentationStyle = .fullScreen
self.present(vc, animated: true, completion: nil)
```### Advanced settings
- Use `MusicPlayerViewCallBackDelegate`.
```swift
public protocol MusicPlayerViewCallBackDelegate: NSObjectProtocol {
func didMusicChange(path: NSString);
}
```- Set `musicIndex` to controll which you want to play.
```swift
musicPlayerVC.musicIndex = 1
musicPlayerVC.doPlay()
```- Make your custome music cover image.
```swift
musicPlayerVC.coverView.image =
```## Screenshots
