Swiftpack.co - HEROHJK/SwiftAudioPlayer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by HEROHJK.
HEROHJK/SwiftAudioPlayer 1.0.1
simple Swift Audio Library
โญ๏ธ 0
๐Ÿ•“ 4 days ago
iOS
.package(url: "https://github.com/HEROHJK/SwiftAudioPlayer.git", from: "1.0.1")

SwiftAudioPlayer

English

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 state
      • unload, load, play, pause, stop, finish
    • currentTimeUpdate -> Check the current section (for Progress)
    • durationChange -> Duration Check
    • rateChange -> Notification of Rate change
  • Playlist under development..

Installation:

Usage:

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")

Korean

๊ฐ„๋‹จํ•œ ์ŠคํŠธ๋ฆฌ๋ฐ/๋กœ์ปฌ ์˜ค๋””์˜ค ํ”Œ๋ ˆ์ด์–ด. ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ธฐ๋Šฅ๋“ค์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

  • ๊ฐ„๋‹จํ•œ 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")

GitHub

link
Stars: 0
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Related Packages

Release Notes

1.0.1
4 days ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics