开发者

load videos to play on iPhone from MySQL using php Webservice

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:

  1. 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?

  2. 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.

  3. 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.

  4. 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

  5. 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.


  1. Program your web server to return a JSON object with the list of movies. You can include preview thumbnails etc.
  2. Include one of the JSON frameworks available (just do a quick search, there are plenty).
  3. Use the data from the JSON feed to display your list.
  4. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜