Play Audio from URL ios - ios

I am developing application like gaana.com
Which player can be used for play mp3 songs from server url ? I want
to implement Play, Pause, Next, Previous buttons And will also play
song list in background mode one by one.
I have already implemented AVPlayer but i getting issue in playing
next audio in background mode. And i had tried all answers regarding
this issue but none of all is working for me.
So i am finding alternative of AVPlayer.

Related

Play but don't record avaudioplayer background music

I have an app that records a video/audio like Instagram stories with avassetwriter and simultaneously plays an audio background music file with avaudioplayer. It both records and plays great.
The problem I am noticing though, is when I play back the recording, the background music is extremely loud, and I'm assuming it's because the mic and the bottom-of-the-phone default speaker, through which the audio background music is playing out of, are situated right next to each other - even though when I record it sounds like it's not that loud.
Is there any possible way or workaround that results in allowing the background music to play while recording but to not have it actually be recorded? I'm stumped on what my options are, and am desperately hoping to see if anyone else had any ideas/thoughts as I couldn't find any existing content addressing this issue.

AVPlayerViewController video's audio background playing and support for multiple formats

I have to do a Video streaming app (using a remote url) in swift. But there is no any exact video format. Sometimes it can be m3u8 sometimes mp4 etc.. but my video player should support for what ever the format comes from the back end.
Also when the app is in background, the audio should play and when the app comes foreground video should play without any time delay between the vide and the audio.
I want to know whether is it possible to achieve my objectives using AVPlayerViewController or else what is the best player that I can use to achieve my targets. Please help me.
Thanks
AVPlayerViewController supports m3u8 and mp4 both format. For playing video's audio you need some extra configuration. You can check from here...
How do I get my AVPlayer to play while app is in background?
Is it possible to play video using Avplayer in Background?
So according to me AVPlayerViewController is best option for your requirement.

Playing audio in the background when using a UIWebView

So I´ve don all the preliminary steps of setting the audioSession sharedInstance category, and activated playing audio in the background in the info.plist file
However I am using an UIWebView to display YouTube, and even thought background playing is
supported, pressing the home button the audio stops. Is this cause YouTube uses some built in player? cause when I play an video my tab bar controller disappears.
Is there a way of having it continue playing the youtube videos in background?

How play music from php without quick time player

I have question. How play music from php/html and others without quicktime player. When i pushed to button in php with mp3 url my iPhone open automaticly quicktime player. But i need only play music from site without quicktimeplayer. How it's make saying please..
You could try using the <audio> tag. See here: http://www.codeproject.com/Tips/226992/Back-Ground-Music-in-Html5
If you don't want to play it immediately, leave off the autoplay attribute and call the .play() function at a later point. (See also: Playing audio with Javascript?)

volume slider has no effect

I am creating a radio streaming app with play, pause and volume slider.
I have implemented volume slider using MPVolumeView but unfortunately it is not working.
Can any one please let me know the correct code so that the volume slider will work in my app. I have used MPMoviePlayerController, AVPlayer, AVAudioPlayer.
Sounds as if you missed an important part of Apple's documentation;
Working with Movies and iPod Music
I am suspecting that you are using both, AVAudioPlayer and MPMoviePlayerController together and that you have setup some audio session attributes to get that working properly. Now when doing so, you may want to tell MPMoviePlayerController to use that session / or not.
Using the Media Player Framework Exclusively
If your application is using a movie player only, or a music player
only—and you are not playing your own sounds—then you should not
configure an audio session.
If you are using a movie player exclusively, you must tell it to use
its own audio session, as follows:
myMoviePlayer.useApplicationAudioSession = NO
If you are using a movie
player and a music player, then you probably want to configure how the
two interact; for this, you must configure an audio session, even
though you are not playing application audio per se. Use the guidance
in Table 6-1.

Resources