iPhone : Can't streaming m3u8 url with AudioStreamer - iphone

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.

Related

Saving m3u8 video to disk in swift cocoa

I am trying to save any m3u8 stream playlist as video to disk as 1 complete video file, similar to vlc. I can create an AVAsset and play it in an AVPlayer fine, however the m3u8 links i have tried all return false from asset.isExportable so using AVAssetExportSession does not work. I thought it might be possible opening the link as an InputStream and then writing it to an OutputStream but was lost on how to do this. Is this a viable option or will it only return the actual m3u8 file instead of the .ts video links? Any guidance in the right direction would be appreciated. I am fine doing the research on how to use the different classes, i'm just kinda lost on where to go from here.
Thank you,
Phil
Building a single video from all the streams in a m3u8 playlist may not actually give you what you want, depending on the m3u8 file.
This is because m3u8 playlists can contain multiple bit rate versions for a single video - so if you added them all together you would get the same video with different quality levels (bit rates) one after another.
Its also worth noting that some videos streams will be encrypted, in fact most high value streams such as Netflix etc will be, so downloading them will not allow you to play them back unless you do it as part of the providers own 'download and go' service.
Finally, some services may make it hard for you to access the streams by requiring some form of authentication in parallel with the video stream URL.
Assuming all the above is fine or does not apply in your case, then the video files themselves can be downloaded as files using a HTTP downloading function. Good examples of these exist such as: https://stackoverflow.com/a/35510812/334402

iOS video player metadata

My question is if there is any built-in interpretation of metadata by the video player in iOS. I know one can add meta-data to a video and interpret it within a custom application as shown here.
In iOS on ipod or iphone, an HTML video is opened within the native player. I would like to display a message above or below the video for a short duration at the beginning. Since I cannot control the native player I thought there might be some built in metadata interpretation that could be used to perform this. I have not been able to find any information on this.
Any help is appreciated.
The blog you've posted includes details on using the native player MPMoviePlayerController to display meta data, which is pretty cool actually. You learn something new every day! If you're making a Phonegap App I suppose you could write a plugin to do this?
Or alternatively, have a look at this other OS question which appears to suggest that it is possible - though not seemingly with metadata embedded in the actual video. Apparently this works on iOS.
Reading metadata from the <track> of an HTML5 <video> using Captionator

stream a single audio file from the internet

I am using the AFNetworking suite in my app. In the app you can record a message, which uploads to a server. I need to be able to play that audio file either by streaming it or chaching it, an ideas on how to do either?
Cheers
Honestly, I would just use AVPlayer and load the remote URL. Per Apple's documentation:
AVPlayer works equally well with local and remote media files, providing you with appropriate information about readiness to play or about the need to await additional data before continuing.
It's certainly possible to use AFNetworking to do this, but I trust that Apple's built-in AVPlayer will be more than suitable to your needs, and certainly worth a shot before rolling your own.
If you want to play a mp3 that is located on the server you can use Matt Galagher's Audiostreamer (http://cocoawithlove.com/2009/06/revisiting-old-post-streaming-and.html).
If you want to play a locally saved file you can use AVAudioPlayer (http://developer.apple.com/library/IOS/#documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html).
If that is not what you want please give us some more datails.

Making internet radio app

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

Best way to stream MP3 from an iPhone app?

I am working on an application that will stream music from a server of mine from an iPhone application.
This is my first iPhone app so I am a bit confused :
What would be the best way to do
this?
Is there something already built in
that I could use, like a MP3 player
that I just need to point toward the
correct server?
Do I need a streaming server to do
so?
I'm relatively new to Objective-C/Cocoa (touch), but I have read an article on the cocoawithlove site titled "Streaming and playing an MP3 stream" and tested the sample code on my iPhone and it works perfectly. I don't know about the licensing or anything, if you would be able to use it, but I'm sure someone or even you can figure that out.
Sorry again for not being able to provide any more information or even a link. This is my first answer on SO and cannot post hyperlinks :(
(edit: Here's the link: Streaming and playing an MP3 stream)