The EZPlayer is an audio player library designed for electrical devices like Mac OS, phones, and televisions using the Swift and objective-C programs. It can play multiple audio file formats, read and generate audio file metadata, and ensure seamless playback even under adverse network conditions.
Features
- Simple, flexible, and compatible APIs
- Support for playing multiple audio formats
- Smooth playback under unstable network conditions
- Real-time background play and lock interface information display
- Switching quality during mid-play
- User-friendly buffer management
- Visual audio spectrum display
- Pre-cache media playback
Installation
Installation in an iOS project is typically done via CocoaPods. Include the following in your Podfile:
platform :ios, '10.0'
use_frameworks!
pod 'EZPlayer', '~> 1.1.2'
Then, run ‘pod install’ in the terminal at the directory of your project.
Usage
Start by importing EZPlayer at the top of your swift file:
import EZPlayer
Configuration
Initiate an instance of EZPlayer:
let player = EZPlayer()
Set up a URL to play:
if let url = URL(string: "http://example.com/example.mp3") {
player?.url = url
}
Control Functions
Use the following methods to control playback:
player.play()
player.pause()
player.stop()
player.seek(to: 100)
Contact & Support
For more information about the EZPlayer, visit the project page on GitHub. You can raise issues and contribute to the project there.