使用 php Web 服务从 MySQL 加载视频以在 iPhone 上播放
任何人都可以指导我吗?我是 iphone/ipad 编程的新手。我将视频存储在我的网络服务器 (apache/php) 上。我需要为 ipad 应用程序编写代码来获取选定用户的视频列表,并使用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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题实际上涉及很多需要实现的内容,但我不确定您现在在哪里:
服务器端编程以公开可以调用的网络服务
获取可用视频的列表。你做过这个吗?以及什么格式
您的服务器端响应是 SOAP XML 还是 JSON?
从你的 iOS 客户端,你首先需要建立一个 HTTP
向 Web 服务 URL 条目发出请求。你做到了吗?您可以
想要使用 ASIHTTPRequest 来节省您的精力。
收到服务器响应后,具体取决于数据的情况
提出,您可能需要找到一个 XML 解析器或 JSON 解析器来
解析原始响应。
然后您需要在播放之前完整下载视频,
或流式播放。您可能再次需要 ASIHTTPRequest
下载。您可能需要 MPMoviePlayerViewController 或
MPMoviePlayerController(如果您想要对播放器布局有更多控制)来播放/流式传输视频,请参阅:
MPMoviePlayerController 和 HTTP 直播
并且不要忘记保存播放列表和用户查看历史记录如果
您希望提供流畅的用户体验。您可以使用简单的
作为 NSUserDefaults/plist 作为数据持久化介质,或者作为复杂的
作为 SQLite 数据库或 Core Data。
我建议你把你的最终目标分解为具体的任务,然后一项一项地去解决。
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.
电影。您可以包含预览缩略图等。
搜索一下,有很多)。
UIWebView
来显示您的电影。如果您不知道如何做任何这些事情,您应该首先考虑 Objective-C 编程教程。
movies. You can include preview thumbnails etc.
search, there are plenty).
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.