How do i stream an audio file from the server to iphone? - iphone

I need to stream an audio file which is saved on my server. Is it possible for me to stream that file in order to play it on my iPhone? Or is there any other way to play an audio file from the server to iPhone? help me please.
Thanks,
Shibin

This link was useful to me : http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html
He's got a project linked from that page http://projectswithlove.com/projects/iPhoneStreamingPlayer.zip
In this project, interesting lines are in iPhoneStreamingPlayerViewController.m, lines 82-89 start streaming the audio from a url.
I've manged to get this running on my iPhone and tested it using an mp3 on another server and it works fine. However, I've not picked through the code so I can't help you anymore than this, sorry!
Sam
NS To get the project to compile I had to change the SDK to 3.0 - if you right click on the project name and choose Get Info, then change the option called Base SDK to iPhone Device 3.0 and it should work.

There's a couple of ways to get the file playing on the iPhone, but the first problem is that you need to decide how to serve the file from your server.
One great way is to share the file out via HTTP using a Web Server. If the server is Windows, look into 'IIS'. If it's a Mac or Linux, Apache is your friend.
Once you've got the serving going, here are the options on the iPhone:
1) Use iPhone Safari to navigate to http://your-server/your-folder/the-file.ext. If the serving is correct, it'll open the mediaplayer and stream it.
2) Write an iPhone application that uses the AVMediaPlayer framework to play the file. Non-trivial, but there are plenty of samples.

Related

Netstream() progressive download of internal file

Hello All I have been working on a project for a while:
I have a non standard MP4 video file I want to play off a server in a IPhone App (I am using Flash builder to create it).
Due to a combination of server problems (not correctly identifying MIME type and cant be changed) and IPhone limitations (e.g. not being able to force the iplayer to play files with wrong extension), I have had to setup a process that reads the file in, saves it locally and then point the video player at the local file.
Although this sort of works, i am having an issue with some of the files that are large (94mb for a 17 min video) and a slow server - which takes 120 seconds to transfer the whole file.
I thought that if you started playing the video, then the transfer rate would be faster than the playback rate so the video would play ok.
However sometimes the video just crashes, which i am guessing is a result of the video reading beyond what has been written.
If the video played the internal file using progressive download I think it would probably not crash but resume once more date had been read but understand that progressive download is triggered by a url extension beginning with HTTP://
Can you make an internal file play using progressive download ? I know this would not normally be expected as logically the system would expect a local file to already be download ?
Any help appreciated
Thanks
Toby
try this to know download file is complete or not
HCDownload
it is very easy to use only write its delegate method.
Edit
also see StitchedStreamPlayer

Looking for a way to record video from an iphone embedded within a web browser and saved to a server

Ok, so I'm working on a project that will allow users to record themselves within a browser and have the video save to the server for later watching.
Right now I have an implementation where I'm using Red5 server with Red5 Recorder and that is working fine, but I'm wondering how exactly you could go about this on an iphone as that is expected to be a large user base.
As far as my research has shown there is no universal way to gather this video within the browser as there is no HTML5 solution and Flash seems to be by far the best way to record webcam to a server.
So what I'm wondering is has anybody encountered this issue and found a solution, whether it be for Iphone only, or a universal solution that would work across all platforms.
At the moment, the only way to accomplish this on the iPhone would be to write a native application. The web browser doesn't give access to the camera, and it doesn't support Flash, Java etc.

Opening a website as an iPad/iPhone in xcode

I'm trying to parse streaming video websites in order to play them in an iPad/iPhone app.
For example, in www.veetle.com, opening a channel with an iPad or iPhone you can see the video, because the code for this finds a .m3u (or .m3u8) file which can be played. But opening from a computer browser, or parsing the channel address in Xcode doesn't show you this .m3u file, it uses flash.
What I want is to get this .m3u file to be able to play the channel, I have been searching all around the web how to open a website as a mobile in Xcode, but I haven't found anything. Any idea?
Thanks.
You need to change the so called user agent string in your request.
See here: Changing the userAgent of NSURLConnection
and here: What is the iOS 5.0 user agent string?
Developer tools for safari also offers the ability so quickly change the user agent which is nice if you just want to quickly check a site: http://designshack.net/articles/developer-tools-in-safari/
Use eg this to see your current user agent: https://duckduckgo.com/?q=user+agent+

iPhone/iPad HTTP streaming library or server

Is there any available open-source (preferred) or commercial library for on-fly segmenting and streaming of video to iPhone / iPad?
Also, is there any open-source/commercial server (alternative to Wowza) which supports this?
Apple offers mediastreamsegmenter:
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html
You might also want to peek at Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad:
https://developer.apple.com/library/content/technotes/tn2224/_index.html
There's also Darwin Streaming Server, but you may not need it.
Your first preoccupation should be to try to peek a good segmenter (video speaking): Apple's one is fine.
Then, if you wan't in-memory segmenting, mount the input source folder to a RAMdisk...
Take a look at following link;
http://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Introduction/Intro.html
This example will show how to play videos from a network based URL.
For more details about playing videos;
You can check red5(java & opensource).
Check lastest beta, or code in svn (as lot hav changed since last officeial release).
It may or may not be able to do that out-of-the-box, if not you can code your red5 app and/or check others people code built arround red5...

"The Server is not configured correctly" message while playing movie in iphone

I am trying to play video files from iPhone media player in my iphone application.I am reading the stream from one Media server.
but i am getting error message as "The server is not configured correctly".
Here is my observation:
-> I kept five different video files on server.(i am sure that all of these files are properly encoded and in right format.)
-> When i try to run same video URL in Mobile Safari i works perfectly without any error.
-> When i try to run any of video it doesn't create any stream on media server.(Usually when i try to play video it create stream on media server.but here the stream is not created on server side.)
-> I tried to play this files using Apple's sample application MoviePlayer but i am facing same issue.(Here i tried to run the application on Simulator)
-> I also checked on my iphone 2G having OS 3.1.2 (jailbreak) but i face same issue.
Please let me know your response on this.
Thanks,
Jim.
You basically need a web server which supports progressive downloads. Apache does support it.
Maybe you want to try the same scenario with the videos hosted on apache.
If that does not work, do post your code.
I have figure out the solution.Actually for some links that i am getting from Server contains bad characters so the URL wasn't right one.
After correcting that issue now i am unable to play all the video file from media server.
Thanks a lot for your help and suggestions.
Thanks,
Jim.