Simple streaming/local audio player. The following features are supported.
- Simple Audio Control
- Simple MPRemoteCommandCenter control (EasyRemoteCenter)
- Rate setting (0.5 ~ 2.0)
- Seeking
- State control observer with RxSwift
stateChange
-> control the player stateunload
,load
,play
,pause
,stop
,finish
currentTimeUpdate
-> Check the current section (for Progress)durationChange
-> Duration CheckrateChange
-> Notification of Rate change
- Playlist under development..
- Added using Swift Package Manager.
https://github.com/herohjk/swiftaudioplayer
- The library RxSwift (6.2.0) and HeLogger libraries are set as dependency packages.
import SwiftAudioPlayer
let player = SwiftAudioPlayer()
player.observers.stateChange
.subscribe(
with: self,
onNext: { owner, state in
switch state {
case .load:
owner.player.play()
default:
break
}
}
)
.disposed(by: self.disposeBag)
player.initItem(urlString: "audio url path")
간단한 스트리밍/로컬 오디오 플레이어. 다음과 같은 기능들을 지원합니다.
- 간단한 Audio 제어
- 간단한 MPRemoteCommandCenter 제어 (EasyRemoteCenter)
- 배속 설정 (0.5 ~ 2.0)
- 구간 이동
- RxSwift를 이용한 상태 제어 옵저버
stateChange
-> 플레이어의 상태 제어unload
,load
,play
,pause
,stop
,finish
currentTimeUpdate
-> 현재 구간 확인 (Progress용)durationChange
-> 오디오 전체 길이 체크rateChange
-> 배속 변경 알림
- playlist 개발중..
- Swift Package Manager를 사용하여 추가.
https://github.com/herohjk/swiftaudioplayer
- 해당 라이브러리는 RxSwift (6.2.0)와 HeLogger 라이브러리가 의존성 패키지로 설정되어 있습니다.
import SwiftAudioPlayer
let player = SwiftAudioPlayer()
player.observers.stateChange
.subscribe(
with: self,
onNext: { owner, state in
switch state {
case .load:
owner.player.play()
default:
break
}
}
)
.disposed(by: self.disposeBag)
player.initItem(urlString: "audio url path")