iOS App和youtube客户端 [英] iOS App and youtube client

查看:182
本文介绍了iOS App和youtube客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此之前,我搜索了有关将youtube集成到ios应用程序的信息。
现在我需要再次这样做,所以我开始寻找有关谷歌的信息。
一段时间后已经困惑。
我可以使用 iOS的youtube示例



或让我使用 YouTube数据API(V3)

API是指用于消费Google功能的HTTP 接口。

  • 可以通过根据API的
    规范直接发出HTTP请求来使用这些API,或者通过使用客户端库。客户端库是HTTP之上的一层,它发出HTTP请求并解析响应。它们提供了一个更简单的接口来调用API(例如,使用给定编程语言中的标准函数调用而不是构建HTTP请求),并且还简化了许多复杂的部分,如身份验证,刷新令牌等。 b $ b

    长答案:

    应用程序编程接口或API是提供者某些功能的使用者和某些功能的使用者,该功能允许该功能的提供者和消费者在不知道另一方的基础实施的情况下进行互操作。该合同包括诸如输入的数量和类型,输入的名称(如果需要调用功能),对输入的任何约束,期望的输出,对输出的任何约束,失败模式等等。

    Google提供了许多基于HTTP的API来访问其服务中的功能。它的服务<​​em>实现这些API,这些API通过发出HTTP请求和读取HTTP响应来使用。 HTTP是一个方便实施的协议,因为每个设备和语言都可以讲HTTP;然而,作为开发人员使用它并不总是最方便的。在很多情况下,你想要的输入和输出都是对象,而不是HTTP请求和HTTP响应。而且,在许多情况下,使用您选择的语言和输入的类型检查来匹配函数签名比记住HTTP请求路径或手动将对象序列化或反序列化为请求中发送的HTTP请求或内容更方便。这就是客户端库所在的地方。尽管HTTP API是在Google的服务器上实现的,但客户端库是开发人员在其应用程序中包含的库,并分发给运行这些应用程序的设备。客户端库发布HTTP请求并解释响应,并为各种不同的编程语言提供更方便的编程语言专用封装。 数据API链接,您提供的是记录基于HTTP的API。鉴于示例应用程序 a>正在使用客户端库(它正在调用基于HTTP的API)。您提供的最后一个链接适用于iOS的云端点与什么不相关你正在努力去做;它记录了一种名为Cloud Endpoints的机制,这是App Engine的一项功能,它允许开发人员使用Google的基础架构创建自己的HTTP API,并自动生成包装这些HTTP API的客户端库(就像Google自动生成客户端库它自己的HTTP API)。


    Time ago I searched informations about the integration of youtube into an ios application. Now I need to do this again so I started looking for information on google. After a short time are already confused. Can I use this iOS youtube sample

    or have I to use YouTube Data API (v3)? And this?

    解决方案

    Short answer:

    1. The API refers to the HTTP interface for consuming Google's funcionality.
    2. One can use these APIs by issuing HTTP requests directly, according to the specification of the API, or by using one of the client libraries. The client libraries are a layer on top of HTTP that issue the HTTP requests and parse the responses. They give a simpler interface for invoking the API (e.g. using standard function calls in the given programming language rather than building HTTP requests) and they also simplify a lot of the complex parts such as authentication, refreshing tokens, etc.

    Long answer:

    An application programming interface or API is the "contract" between a provider of some functionality and the consumer of some functionality that allows both the provider and consumer of that functionality to interoperate without knowledge of the underlying implementation of the other party. This "contract" includes such things as the number and types of the inputs, the names of the inputs (if it is required to invoke the functionality), any constraints on the inputs, the expected outputs, any constraints on the outputs, failure modes, etc.

    Google provides a number of HTTP-based APIs for accessing functionality from its services. Its services implement these APIs, which are consumed by issuing HTTP requests and reading the HTTP responses. HTTP is a convenient protocol to implement, because every device and language can speak HTTP; however, it is not always the most convenient to use as a developer. In many cases, the inputs and outputs you want are objects, not HTTP requests and HTTP responses. And, in many cases, matching function signatures in the language of your choosing and type-checking of inputs is more convenient than memorizing the HTTP request paths or manually serializing/deserializing your objects to HTTP requests or content sent within the request. That is where the client libraries come in. Whereas the HTTP APIs are implemented on Google's servers, the client libraries are libraries that developers include in their application and are distributed to the devices on which those applications run. The client libraries issue the HTTP requests and interpret the responses, and provide a more convenient programming language-specific wrapper, for a variety of different programming languages.

    The data API link that you provided is documenting the HTTP-based API. Whereas the sample application is using the client library (which is invoking the HTTP-based API under the hood). The last link you provided, the cloud endpoints for iOS is unrelated to what you are trying to do; it is documenting a mechanism called Cloud Endpoints, a feature of App Engine, that allows developers to create their own HTTP APIs using Google's infrastructure and to auto-generate client libraries that wrap these HTTP APIs (much as Google auto-generates the client libraries for its own HTTP APIs).

    这篇关于iOS App和youtube客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆