In this part of tutorial, I am going build a simple player interface with HysteriaPlayer.
The simple interface with those basic views and elements.
- Play, Pause, Next, Previous function
- Repeat, Shuffle function
- Playing item's current and duration time
- Slider that seeks to time in HysteriaPlayer
- Artwork with SpinningDiskView
In part 0, what we want? why HysteriaPlayer?
In part 1, demonstrating how to play remote audios with HysteriaPlayer.
In part 2, making a simple player user interface.
In part 3, registering lock screen details and remote controls.
You can download source code here with branch
I created a new
PlayerViewController class extends
UIViewController and dragged some views on xib. Assuming everyone is familiar with that. We skip this process.
We have to implement
HysteriaPlayerDelegate protocol in
HysteriaPlayerDelegate protocol have four optional methods that releated to interface updating. Docs
- - (void)hysteriaPlayerCurrentItemChanged:(AVPlayerItem *)item;
- - (void)hysteriaPlayerRateChanged:(BOOL)isPlaying;
- - (void)hysteriaPlayerDidReachEnd;
- - (void)hysteriaPlayerCurrentItemPreloaded:(CMTime)time;
PlayerViewController.m, we have to add and remove delegate with
removeDelegate: mothods when
PlayerViewController didAppear and didDisappear.
HysteriaPlayer not using
HysteriaPlayer.delegate but add/remove delegates because it allows multiple delegates at the same time.
HysteriaPlayerDelegate protocol methods:
I used SpinningDiskView to display artwork.
seetToTime, current/duration time, next, previous...