All Projects → tschob → Audioplayermanager

tschob / Audioplayermanager

Licence: mit
⚠️ No longer maintained ⚠️ Small Swift Wrapper and Queue-Manager around AVPlayer which let you play MediaPlayer items and stream songs from URLs.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Audioplayermanager

audioStreamDemo
A music player created in swift using AVPlayer to stream audio from server.
Stars: ✭ 33 (-57.69%)
Mutual labels:  audio-player, avplayer
SoundDeck
Sound Deck is a powerful audio-focused plugin for the Elgato Stream Deck.
Stars: ✭ 20 (-74.36%)
Mutual labels:  streaming, audio-player
player
Proton Player is an HTML5-based streaming music player optimized for compatibility across many devices and browsers.
Stars: ✭ 84 (+7.69%)
Mutual labels:  streaming, audio-player
Fradioplayer
A simple radio player framework for iOS, macOS, tvOS.
Stars: ✭ 183 (+134.62%)
Mutual labels:  audio-player, avplayer
Openmessaging Java
OpenMessaging Runtime Interface for Java
Stars: ✭ 685 (+778.21%)
Mutual labels:  queue, streaming
Musikcube
a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++
Stars: ✭ 2,663 (+3314.1%)
Mutual labels:  audio-player, music-library
Bibleify Desktop
🖥️Simple & fast bible app with dramatized audio built with Electron, React, Rematch & Realm
Stars: ✭ 70 (-10.26%)
Mutual labels:  audio-player, streaming
Swifty360player
iOS 360-degree video player streaming from an AVPlayer.
Stars: ✭ 118 (+51.28%)
Mutual labels:  avplayer, streaming
Jocko
Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
Stars: ✭ 4,445 (+5598.72%)
Mutual labels:  queue, streaming
Tchaik
Music organisation and streaming system in Go
Stars: ✭ 331 (+324.36%)
Mutual labels:  music-library, streaming
Swiftaudio
Audio player for iOS
Stars: ✭ 160 (+105.13%)
Mutual labels:  audio-player, avplayer
Taliesin
Lightweight audio streaming server
Stars: ✭ 35 (-55.13%)
Mutual labels:  audio-player, streaming
Nymphcast
Audio and video casting system with support for custom applications.
Stars: ✭ 2,010 (+2476.92%)
Mutual labels:  audio-player, streaming
Swift Radio Pro
Professional Radio Station App for iOS!
Stars: ✭ 2,644 (+3289.74%)
Mutual labels:  audio-player, avplayer
Abmediaview
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Stars: ✭ 79 (+1.28%)
Mutual labels:  audio-player, avplayer
openmessaging.github.io
OpenMessaging homepage
Stars: ✭ 12 (-84.62%)
Mutual labels:  streaming, queue
Specification
OpenMessaging Specification
Stars: ✭ 242 (+210.26%)
Mutual labels:  queue, streaming
amplyfm
A free and open-source web app for streaming music.
Stars: ✭ 46 (-41.03%)
Mutual labels:  streaming, audio-player
React Native Streaming Audio Player
Streaming audio player for both iOS and android
Stars: ✭ 33 (-57.69%)
Mutual labels:  audio-player, streaming
Gogglesmm
Goggles Music Manager
Stars: ✭ 41 (-47.44%)
Mutual labels:  audio-player, music-library

⚠️ This library is no longer maintained. Feel free to fork it, add the code to your project and modify it or use alternatives. It's too much overhead for me to maintain it as I don't have a project anymore in which I use it. ⚠️

AudioPlayerManager

Build Status CocoaPods compatible Carthage compatible License Platform Language: Swift 4.2

Feature

AudioPlayerManager is a small audio player which takes care of the AVPlayer setup and usage. It uses an internal queue to play multiple items automatically in a row. All path based items which are supported from AVPlayer can be used (MPMediaItems and remote URLs).

Requirements

  • iOS 8+
  • Xcode 8+

Installation

Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate AudioPlayerManager into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'AudioPlayerManager'
end

Then, run the following command:

$ pod install

Usage

There two basic usages:

  • A singleton player which play one item at a time
AudioPlayerManager.shared.setup()
  • Multiple player instances which can be used at the same time
let audioPlayer = AudioPlayerManager.audioPlayer()

Setup

In both usage cases you need to setup() the player instance before using it.

AudioPlayerManager.shared.setup()

This will setup the AVAudioSession playback plus activation state and initialize the remote control events plus now playing info center configuration. If you want to modify the basic settings you can this after calling setup.

AudioPlayerManager.shared.setup()
AudioPlayerManager.shared.playingTimeRefreshRate = 1.0

If you want to reveive remote control events you simply have to pass the events from the app delegate to the audio player instace

override func remoteControlReceived(with event: UIEvent?) {
	AudioPlayerManager.shared.remoteControlReceivedWithEvent(event)
}

Playback

AudioPlayerManager can play local MPMediaItems and stream items from a remote URL. You can pass either one or multiple items to the player.

The following line will replace the current queue of the audio player with the chosen item. The playback will stop automatically if the item was played.

AudioPlayerManager.shared.play(url: self.trackUrl)

If you want to play multiple items you can pass an array and start index. The audio player will replace the current queue with the given array and jump right to the item at the given index. The queue allows the user to rewind also to items with a lower index than the start index.

let songs = (MPMediaQuery.songsQuery().items ?? [])
AudioPlayerManager.shared.play(mediaItems: songs, at: 5)

Author

tschob, Hans Seiffert

License

AudioPlayerManager is available under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].