Can any one please guide me on this . I am new to iphone/ipad programming.I store videos on my webserver (apache/php).I need to write code for an ipad app to get the videos list for开发者_JAVA百科 a selected user and play those videos on the ipad/iphone using a php webservice.I was not able to get going on this.Please can anybody share any related links or shower your thoughts on this ? Any help would be highly appreciated.
Thanks
your question actually involves a lot to implement, but I'm not sure where you're right now:
Sever-side programming to expose web-service which can be invoked to get a list of available videos. Have you done this? And what format your server-side responses, SOAP XML or JSON?
From your iOS client side, you firstly need to establish an HTTP request to the web-service URL entry. Have you done that? You may want to use ASIHTTPRequest to save your effort.
Once you've got server response, depending on how the data is presented, you may need to find a XML parser or a JSON parser to parse the raw response.
Then you need to either download the video entirely before playback, or stream the playback. You may again need ASIHTTPRequest for downloading. You may need MPMoviePlayerViewController or MPMoviePlayerController(if you want more control over the player layout) to plackback/stream the video, see: MPMoviePlayerController and HTTP Live Streaming
And don't forget to save the playlist and user viewing history if you want to provide a smooth user experience. You may use as simple as NSUserDefaults/plist as the data persistence media, or as complex as SQLite database or Core Data.
I suggest you to break down your ultimate goal into specific tasks, and tackle them one by one.
- Program your web server to return a JSON object with the list of movies. You can include preview thumbnails etc.
- Include one of the JSON frameworks available (just do a quick search, there are plenty).
- Use the data from the JSON feed to display your list.
- When the user clicks on an item, launch a view controller with a
UIWebView
to display your movies.
If you do not know how to do any of these things, you should consider an objective-C programming tutorial first.
精彩评论