Making internet radio app - iphone

I'm making my own internet radio app with a custom interface. So i'm wondering what is the best tool to implement the audio playback with a custom interface? I tried to use MPMoviePlayerController, but i couldn't find out how to customize it's interface. I also tried AVPlayer, but somehow it didn't play the .m3u files, though it worked perfectly well with .m3u8 playlists from apple test http live stream examples.

Use audiostreamer its also having a good example https://github.com/mattgallagher/AudioStreamer
cheers endo

Related

Custom audio control for ios apps

We are creating an app using Swift on IOS that needs to use custom audio controls: a play button, a stop button, a current time/pos indicator, the duration and perhaps even a seek bar to play 1 audio file that is built into the application. My friend has worked hard on this project but so far was unable to find a solution. Is it possible using mediaplayer or is another api easier, possibly something similar to exoplayer for android apps.
Thanks.
In my opinion I would say that using AVFoundation would probably be easiest since it is built into swift you just have to do import AVFoundation and you would probably want to create an AVAudioPlayer to listen to the music. Also the API is pretty simple. If you need any help getting started I found this article on Mashable that shows how to play audio and how to control it with a custom play and pause button. https://medium.com/yay-its-erica/creating-a-music-player-app-in-swift-3-53809471f663. Also I found on Apple's documentation how to get the current time of the audio playing https://developer.apple.com/documentation/avfoundation/avaudioplayer/1387297-currenttime. I hope I was able to help and if you have anymore questions don't hesitate to ask!

iPhone : Can't streaming m3u8 url with AudioStreamer

I'm using Matt Gallagher's AudioStreamer to perform audio streaming in app, the URLis coming from server, right now its of type .m3u8 format, and the problem is ON, before it was of .mp3type and streamed normally. It showing an error "No audio data found". However I tried to play URL in Safari browser in simulator and its playing good so there's no problem with the URL.
I've been searching long in google but it was ended with these two SO questions. Question-1, Question-2, but none of having the answer of it yes one has solution to play it using MPMoviePlayerController but I want to stream the same with the same I've.
So I dig into code of AudioStreamer .h and .m files, where I get to know that the logic of file type selection is at #line no. 555
+ (AudioFileTypeID)hintForFileExtension:(NSString *)fileExtension { .... }
an AudioFileTypeID need to return there, the list is defined in AudioFile.h of AudioToolbox.framework doesn't contains .m3u8 file type so I can't return it here (I tried for patching with different types there).
I tried to find any alternative types (which can be use instead of this) but no results I get. Then I gone through Apple Doc, and Issues Discussion but none of helped me!
P.S. I've checked AudioToolbox.framework in iOS6.0. to check for the availability of file type but it doesn't exist at all.
Any solution?
You can try with mpmovieviewcontroller. I am also using it for playing streaming audio in one of my Apps. For streaming type content (Like audio/video from web services or from internet) then it is perfect player. And it also look like iPhone default player. Search some tutorial on it & implement it. It is easily be implemented also.

playing downloaded audio video in iphone

Hi seen many tutorial but couldn't find the right workable answer. I need to play audio and video file from my webservice, for this I want to download the file and play it in the app, seen tutorial for avPlayer nothing workable. Please provide link or guide how to do this.
Use MPMoviePlayer, as this can open network streams and despite the name works with audio. The only thing is this pops up the modal player with controls.
First Download the network file using NSURLConnection and store it locally, then use AVAudioPlayer to play the local file.

Dropbox app like video & audio preview

How do I generate a audio and video preview function exactly like it is in Dropbox iPhone app? Is it AVPlayer or MPMoviePlayer? Or is it custom made controls and slider? I need exact same controls and slider option.
Also I need to play the video and audio using a web service. The files are on the server. So I need to buffer them and play them as they get buffered.
Please suggest some help.
I'm not sure what is in the Dropbox app.
AVPlayer doesn't include any search etc. controls, and adding them yourself is fiddly. Consider instead MPMoviePlayerViewController (a newer controller class which wraps the old MPMoviePlayerController).
Be aware of the iOS limitations of whatever classes/techniques you use. For example, if you want your code to work pre-iOS3.2, you need to use MPMoviePlayerController directly (when running on iOS < 3.2) instead of MPMoviePlayerViewController. If the device iOS >= 3.2, you use MPMoviePlayerViewController.
Disclaimer: I don't know all of your requirements etc. For a good overview of the complicated history of multimedia APIs, check out this page.

Can we play only audio using youtube api for iPhone

In my project i have to use youtube api and play only audio of the video. We must not show the youtube player. Is it possible to play only audio without showing video using youtube api?
Extraction may be the incorrect implied word here. From what I understand, is user133611 wants to have an audio only stream from YouTube. Unfortunately, YouTube directly forbids it. Here is a quote from Kuan Yong from the YouTube API team:
Your API Client will not, and You will not encourage or create
functionality for Your users or other third parties to:
"separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team
Link reference: https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/7fac8e8ff913b6c4?pli=1
I don't think this is really possible only using Youtube API. The Youtube API is not intended to be used for "downloading" videos/audio from them. You should go here, to understand what the Youtube API is really about.
A small abstract:
Unless I am missing something really big, the Youtube API consists of 5 main parts:
Data API
Custom Player
YouTube Direct
Player APIs
Widgets
None of this APIs allow you to for example "download" a video. Also I think (correct me if I'm wrong), that in a youtube video, the audio is actually embedded in the flash video, making the task even less trivial.
To illustrate you, the Data API, allows you to perform and use the youtube video search capabilities, use playlist capabilities and many more of the operations available on the YouTube website.
That have being said, the Youtube API, can be used for example to upload a video from your iPhone to youtube, as this example illustrates.
My Thoughts:
I think that extracting the audio from a youtube video, is actually possible, but involves a whole different process of downloading the video in H264 and then extracting the audio... but it still involves downloading the whole video.
Is the audio only prohibition still valid? Streamus is available as a Chrome Extension. It streams audio only from YT - see website https://streamus.com/
Well, one can simply give the video a width and height of 1px, or better yet do:
.video { text-indent: -9999px; }
And then force the video to play via the API controls. But I wouldn't do it as it is against their TOS and would result in my app being blocked if they find out.
I really confused about your platform. Do you want to do it over iOS platform with writing native code? If yes, you can do it without playing video. But you have to stream both video and music. You can do it with AVAudioPlayer Class, check the reference from
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/
But yes, you will makes users GSM data overload and it's not fair with letting users about that situation.
Maybe you can force your view over the youtube view? Have you tried that?
If it is against TOS, the op should just drop the idea of implementing his idea.
Just imagine the free music everyone will be streaming out of the promo videos of major videos on youtube!