Swiftpack.co - ddddxxx/MusicPlayer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ddddxxx.
ddddxxx/MusicPlayer v0.8.3
Music player submodule for LyricsX
⭐️ 37
🕓 2 years ago
iOS macOS linux
.package(url: "https://github.com/ddddxxx/MusicPlayer.git", from: "v0.8.3")

MusicPlayer

Github CI Status codebeat badge

Music player submodule for LyricsX.

Unified API for music players.

Supported Players

macOS

  • ☑ Apple Music (iTunes)
  • ☑ Spotify
  • ☑ Vox
  • ☑ Audirvana
  • ☑ Swinsian

iOS

  • ☑ Music
  • ☐ Spotify (see #5)

Linux

Read me before using MPRIS
dependencies
  • playerctl (could be installed by package manager)

A running GMainLoop is required to automatically update the player and playback status for MPRIS. If not, you can run one by:

GRunLoop.main.run()

or in other threads:

Thread.detachNewThread { 
    GRunLoop.main.run() 
}

Universal

  • SystemMedia: System-wide Now Playing
    • ☑ macOS
    • ☑ iOS (jailbroken device only) (test needed)
    • ☐ Windows (via SMTC)
  • ☐ Spotify (Web API)

Helper:

  • ☑ Agent: Delegate events to another player.
  • ☑ Now Playing: Automatically choose a playing player from given players.
  • ☑ MPRIS Now Playing: Just like Now Playing, but automatically find available MPRIS players.
  • ☑ Virtual: A virtual player that allows you to manipulate its state.
  • ☐ Remote: Sync player state from other devices.

Usage

Quick Start

let player = MusicPlayers.Scriptable(name: .appleMusic)!
let track = player.currentTrack.title
if player.playbackState.isPlaying {
    player.skipToNextItem()
}

License

MusicPlayer is part of LyricsX and licensed under MPL 2.0. See the LICENSE file.

GitHub

link
Stars: 37
Last commit: 35 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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