Welcome to the documentation for the BeamMusicPlayerViewController framework, an iOS library that provides a music player view controller for your app. This framework allows you to easily integrate music playback functionality into your application with minimal effort.
Installation
To install the BeamMusicPlayerViewController framework into your project, you have two options:
Option 1: Cocoapods
- Add the following line to your Podfile:
- Run the
pod install
command. - Import the framework wherever you need it:
import BeamMusicPlayerViewController
.
pod 'BeamMusicPlayerViewController'
Option 2: Manual
- Download the latest release from the GitHub repository.
- Drag and drop the framework into your Xcode project.
- Make sure to check the “Copy items if needed” option.
- Import the framework wherever you need it:
import BeamMusicPlayerViewController
.
Usage
To use the BeamMusicPlayerViewController framework in your app, follow these steps:
Step 1: Setup
First, import the framework into your view controller:
import BeamMusicPlayerViewController
Then, instantiate a new instance of the BeamMusicPlayerViewController
:
let musicPlayerVC = BeamMusicPlayerViewController()
Step 2: Configure Player
Configure the music player by setting the following properties:
musicPlayerVC.trackTitle
: The title of the currently playing track.musicPlayerVC.artistName
: The name of the artist of the currently playing track.musicPlayerVC.albumArtwork
: The image representing the album artwork of the currently playing track.musicPlayerVC.trackDuration
: The total duration of the currently playing track.
Step 3: Control Playback
Control the music playback using the following methods:
musicPlayerVC.play()
: Start playing the current track.musicPlayerVC.pause()
: Pause the current track.musicPlayerVC.seek(to: TimeInterval)
: Seek to a specific time position in the current track.musicPlayerVC.nextTrack()
: Play the next track in the playlist.musicPlayerVC.previousTrack()
: Play the previous track in the playlist.
Step 4: Present View Controller
Finally, present the music player view controller:
present(musicPlayerVC, animated: true, completion: nil)
Conclusion
Congratulations! You have successfully integrated the BeamMusicPlayerViewController framework into your app. You can now provide a seamless music playback experience to your users. Remember to refer to the complete documentation for more detailed information and advanced features. Enjoy building your music app!