Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddddxxx/MusicPlayer
Music player submodule for LyricsX
https://github.com/ddddxxx/MusicPlayer
apple-music audirvana combine-compatible-package itunes music spotify swinsian vox
Last synced: 14 days ago
JSON representation
Music player submodule for LyricsX
- Host: GitHub
- URL: https://github.com/ddddxxx/MusicPlayer
- Owner: ddddxxx
- License: mpl-2.0
- Created: 2017-08-30T01:50:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T03:41:56.000Z (about 1 year ago)
- Last Synced: 2024-10-01T21:16:21.533Z (about 1 month ago)
- Topics: apple-music, audirvana, combine-compatible-package, itunes, music, spotify, swinsian, vox
- Language: Objective-C
- Homepage: https://github.com/ddddxxx/LyricsX
- Size: 5.35 MB
- Stars: 39
- Watchers: 3
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MusicPlayer
[![Github CI Status](https://github.com/ddddxxx/MusicPlayer/workflows/CI/badge.svg)](https://github.com/ddddxxx/MusicPlayer/actions)
[![codebeat badge](https://codebeat.co/badges/1e88cb27-5d83-48d0-b50b-ad88593e2b5f)](https://codebeat.co/projects/github-com-ddddxxx-musicplayer-master)Music player submodule for [LyricsX](https://github.com/ddddxxx/LyricsX).
Unified API for music players.
## Supported Players
#### macOS
- [x] Apple Music (iTunes)
- [x] Spotify
- [x] Vox
- [x] Audirvana
- [x] Swinsian#### iOS
- [x] Music
- [ ] Spotify (see [#5](https://github.com/ddddxxx/MusicPlayer/issues/5))#### Linux
- [x] [MPRIS](https://specifications.freedesktop.org/mpris-spec/latest/) (test needed) (Thanks to [@suransea](https://github.com/suransea))
Read me before using MPRIS
##### dependencies
- [playerctl](https://github.com/altdesktop/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:
> ```swift
> GRunLoop.main.run()
> ```
> or in other threads:
> ```swift
> Thread.detachNewThread {
> GRunLoop.main.run()
> }
> ```#### Universal
- SystemMedia: System-wide Now Playing
- [x] macOS
- [x] iOS (jailbroken device only) (test needed)
- [ ] Windows (via [SMTC](https://docs.microsoft.com/en-us/uwp/api/windows.media.systemmediatransportcontrols))
- [ ] Spotify (Web API)#### Helper:
- [x] Agent: Delegate events to another player.
- [x] Now Playing: Automatically choose a playing player from given players.
- [x] MPRIS Now Playing: Just like Now Playing, but automatically find available MPRIS players.
- [x] Virtual: A virtual player that allows you to manipulate its state.
- [ ] Remote: Sync player state from other devices.## Usage
### Quick Start
```swift
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](LICENSE).