AVAudioplayer should automatically switch to next song - objective-c

i have created a music application in which there are 90 songs.when i click on a particular song it plays. i need that when i click on a particular song it should switch to next song automatically when the current songs completes.Please help me in solving this problem

Use an AVAudioPlayerDelegate to detect when a song finishes playing (audioPlayerDidFinishPlaying:successfully:). Then start playing the next song.

Related

What is the simplest way to create a music player using react-native-sounds with play & pause toggle controls in same button?

I wanted to create a music player using react-native-sounds but and it was playing music flawless but the issue wast it was not stoping when i press the button, btw the button of play & pause is same.I also want it to pause when another track is playing or navigating out of that screen.
I have tried giving all type of condition's in the button to play and pause on state change,
twist is that when I use seprate button it pause and play fine but not in same button.

Wear OS Tiles: How would one update UI dynamically

So I am working to build media tile, but whenever I play the a next song and use getUpdater(applicationContext).requestUpdate(MyTileService::class.java)
it take few seconds before it refreshes the tile, so the next song starts but, the content of the tile do not change. I tries passing the new song title in the tile refresh code, but the tile refreshes before the variable refresh.
when(request.state!!.lastClickableId) {
"play" -> pauseLayout(songTitle_txt!!,request.deviceParameters!!)
"pause" -> playLayout(songTitle_txt!!,request.deviceParameters!!)
else ->pauseLayout(songTitle_txt!!,request.deviceParameters!!)
}
I am also trying to figure how to update the ARC using the song progress, I can archived it the actual Wear OS app, but confused when it comes to tiles. Can one get a reference to the tile elements and only update those ?
I think onclick actions might be different, but if an external event (play time, song name after it changes) is the trigger you will be limited in how often you can update.
See https://stackoverflow.com/a/70565444/1542667

How to pause a song when another song starts?

I am developing windows phone app. I added list of 10 songs in it.
Problem:when I am playing 1st song an after some times if I starts 3 rd or any other song then how to pause the running song?

Multiple videos on screen using MPMoviePlayerController

What I want to achieve here is a screen with 2 or more different videos on at a time. I know in the apple documentation it says you can't have more than one video playing at a time and thats fine, I don't want to do this.
All I want is to have the 2 videos on screen and when you press on it, it starts to play, you can go fullscreen if you want but as soon as you press on a different video, the old video stops and the new one starts.
I already have three MPMoviePlayerController set up with the correct position, size and video and the 3 boxes are all drawn to the screen but at the moment, only the last one to be drawn to screen can actually be watched.
Does anybody know if there is any way to achieve this or not and if so, how would I go about it?
Thanks,
Matt
As for as I know, you can only have one active movie player at the same time. It's a limitation from MPMoviePlayerController. Message in Apple documentation :
Note: Although you can create multiple MPMoviePlayerController objects
and present their views in your interface, only one movie player at a
time can play its movie.
Source : http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

iPhone SDK Question with Audio/Mic

I am trying to do an app, to where when it launches, it will detect audio, and then play it back automatically. NO BUTTONS, nothing to press. Just a picture of something then, it listens for audio, then plays it back. Similar to the Talking Carl app in the App Store. Any ideas/help? Would appreciate it, if i could use the code with IB.
Work through this example:
http://www.iphoneam.com/blog/index.php?title=using-the-iphone-to-record-audio-a-guide&more=1&c=1&tb=1&pb=1
And then you'll want to put the code for recording and playing back the audio in the viewDidLoad method of whichever view is your main view.
One thing you might also want to consider is how long you want it to record before it plays it back? And also, you'll want to stop recording once the sound starts playing... and also you'll want to start recording again once the sound STOPS playing.... all these things to think about and learn about :)