Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewbrns/ammediaplayer
A simple wrapper around AVQueuePlayer
https://github.com/drewbrns/ammediaplayer
Last synced: 24 days ago
JSON representation
A simple wrapper around AVQueuePlayer
- Host: GitHub
- URL: https://github.com/drewbrns/ammediaplayer
- Owner: drewbrns
- License: mit
- Created: 2023-09-29T21:45:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-21T01:12:40.000Z (12 months ago)
- Last Synced: 2024-11-19T23:51:15.637Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AMMediaPlayer
A simple and lightweight wrapper around AVQueuePlayer with the aim of making audio streaming simple and decoupled from your main code
# Installation
AMMediaPlayer can be installed via [Swift Package Manager](https://www.swift.org/package-manager/).# Basic Usage
```
// Import library
import AMMediaPlayer// Prepare the assets you want to play
let urlAssets = [
AVURLAsset(url: audioUrl, options: nil) // audioUrl can be a local url or a remote url
]// Load the assets in the player
do {
try await AMMediaPlayer.shared.enqueue(urlAssets: urlAssets)
} catch {
// Handle Errors
}// Play the asset
AMMediaPlayer.shared.play()```
# Minimum Requirements
iOS 13# License
AMMediaPlayer is available under the MIT license. See the LICENSE file for more info.