Play mp3 from web with MPMoviePlayerController over 3G - ios

In my app I use MPMoviePlayerController to play an mp3 file from a web server. This plays while downloading the whole file, which is fine over WiFi. But now I want it to work over 3G (and get it into the app store). How do I get it to just buffer the next 10 seconds or so (as per apple rules)? I'm digging through the documentation on AVPlayer, HTTP Live streaming, etc, but I'm still confused about the best way to do this. With so many podcast apps out there, I'm suprised there aren't more tutorials/libraries about it.
Thanks for your time.

I investigated this as well, and I was not able find a way to limit the look-ahead buffer using MPMoviePlayerController. I believe you would have to load chunks at the network layer and feed them in at the AVFoundation layer, but I have not attempted this myself.
That said, I can confirm that you can get an app approved that plays mp3 files using MPMoviePlayerController over both WiFi and 3G connections. In my app I added a setting so the user can decide whether to enable mp3 downloads over 3G or not, although I don't know if that was needed to get approved. I provided it so users didn't inadvertently incur bandwidth costs.

Related

iOS requirement for live steaming

I'm working on the live streaming app like Periscope and doing research on requirement and restriction on iOS.
I found out that Apple only allows HLS (Http Live Streaming) for certain conditions. I found such conditions below from apple site.
If your app delivers video over cellular networks, and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period, you are required to use HTTP Live Streaming.(https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-SW5)
But I'm not sure that HLS should be used for both publishing and watching video or only for watching is acceptable? Because i thinking of using RTMP for publishing and HLS for watching.
I wrote an app similar to periscope that is on the app store now and it can use 2Mbps and connects via RTMP protocol to send the data. So my guess is they no longer enforce it. I also beleive that at the time that that was written cell service load was possibly to high and they were hoping that HLS would help with that would be my guess. Now with 4gLTE it can handle the loads a little better. Again that is just a guess. My app went up with no problem or mention of that and the review team was more than aware what the app did.

Broadcast-streaming of live audio contents between iPods

After a lot of searching in the web I am going to ask here my question:
I want to stream audio between iPods WITHOUT or with less buffering. I am thinking of something like RTP or WebRTC for iOS.
The app which I will develop, enables one iPod to capture the microphone and to stream the audio to the other 50-100 iPods (Broadcast), but all this has to be LIVE.
One speaker's talk is recorded live and the other iPod's can hear the speaker at the same time with very less delay...
Is such a thing possible? Are there frameworks or software existing to handle this? I prefer Objective-C and HTML5.
I would be really happy getting any help. Thanks in forward.

Is RTSP allowed on iOS or one MUST use Http Live Streaming instead?

Apple Http Live Streaming Overview document clearly states that streaming videos exceeding 10 minutes cannot be downloaded progressively and MUST be transferred using Http Live Streaming(HLS). It also states that the latency of HLS is in the neighbourhood of 30 seconds.
In my case, I am building an app that needs to receives live steaming videos in almost real-time. So on one hand I must use HLS for real time streaming but it is not fast enough. On the other hand I can not use anything else because it seems anything other than HLS is not allowed. I know RTSP is possible on iOS but will it be approved by the App Store?
Cheers,
M.
Apple is not transparent. The only way to know if an app will be rejected or accepted is to submit it.

Stream live video from ipad? [duplicate]

I'd like to stream video from the camera on an iOS device to a receiver via wifi, in effect turning the device into a wireless webcam. Is there a way to build a small app that captures video input on an iOS app and sends it via an RTSP stream or similar?
As this is an ad hoc experiment, I'm not concerned about App Store guidelines and can jailbreak if necessary.
If I interpret your question correctly you more or less need to solve four problems:
Get the camera feed.
Convert/encode this to the right format.
Stream the data.
Prevent the phone from locking itself and going into deep sleep.
The first one is fairly simple and Apple has as always provided good documentation and examples -> API link. Make sure you check out their example in the end as you will get a CMSampleBufferRef data object back.
For the second and third part, you should check out the CFNetwork framework and specially CFFTPStream for streaming using FTP.
If your are only building this for yourself then you can always turn off the Auto-Lock feature in the settings. If you on the other hand would like to distribute this to other users you could use a trick to play a mute sound every 10 seconds. This is more or less how all the alarm clocks work in the App Store. Here's a tutorial. =)
I hope I helped a little bit at least.
Good luck and best regards!
I'm 70% of the way to doing the same thing. Here's how I did it:
Capture content from video input
Chop video into files for use in HTML Live Streaming.
Spin up a web server on the iPhone and make the video files available.
Connect to the IP address of the phone and viola! you've got live streaming video.
Last time I touched the code I was trying to debug my Live Streaming not working. I'll try and get my source code posted on github this weekend, if you'd like to take a look.

How do I download a youtube video in iOS

I know how to launch a youtube video within an iOS web view, but how can I download that video to save on my iPad app? Is it possible? Do I need to use some call with a NSURLConnection object and then save the received data into the proper file format?
One specific point I am unsure about is what the url to request the file would be. When viewing a video on youtube, the downloadable videos are triggered with a button, so it's not evident to me what the url would be.
You would need to download an iOS-compatible version of the video, possibly using the same technique employed by the Safari FlashToHTML5 plugin.
Youtube DOES offer video download links:
http://lifehacker.com/#!5152236/youtube-offers-official-downloads-and-purchases-for-videos
.. make sure you do not violate their TOS.
In general, when downloading large files, you might consider implementing resumable file downloads, especially because connectivity on a mobile device is transient.
On top of that, make sure that you're on a wifi network when downloading (or resuming a download), using Reachability. Note that excessive bandwidth usage over cellular networks is a reason for app rejection.

Resources