AVAudioPlayer to play in multiple views but access the same song
I am trying to control audio from many different views. Is there an easy way to do this?
I have made a view/class and put all the audio enablers inside and then reference it. I did that by making a IBOutlet and then accessing my audio player in that view from other views using that.
Except ever time I start the song with accessing that view from another view it adds another song that is playing.
Long story short:
When i am in view1 and access musicview it starts the song and if im in view2 and access music view it plays another song on top of the one i started in view1.
I would like both views to control the same song.
Someone please help me here.
|