retrive从YouTube API唯一的移动支持视频 [英] retrive only mobile-supported video from YouTube API
问题描述
我使用YouTube API检索视频的和Android客户端。
I'm using the YouTube API to retrieve videos for and Android client.
该计划运作良好,但有时我得到这个视频是不允许在智能手机上运行的错误。
The program works well but sometimes I get an error like "this video is not allowed to run on smartphones".
所以,有一种方法来过滤视频?我读<一href="https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#categorysp"相对=nofollow>这个文档,但没有找到一个解决方案。
So, there is a way to filter that videos? I read this doc but did not find a solution.
推荐答案
有两个概念嵌入和银团。 iOS设备使用iframe所以他们基本上嵌入。 使用播放器API Android设备可以检查辛迪加。
There are two concepts embeddable and syndicated. iOS devices use iframe so they basically embed. Android devices that use player API can check syndicated.
当你做一个搜索 - >列表,您可以设置 videoEmbeddable 和的 videoSyndicated 为true。
When you do a search->list, you can set videoEmbeddable and videoSyndicated to true.
有关Android的,你应该检查 videoSyndicated 。
For Android, you should check videoSyndicated.
或者,如果你是通过迭代的影片,每部影片,你可以做一个 video->列表视频显示来电,并检查 status.embeddable 的在响应中。
Or if you are iterating through videos, for each video, you can do a video->list call with video id and check status.embeddable in the response.
下面是一个博客帖子这个话题,甚至虽然例子是在V2中,信息仍然是相关的。
Here is a blog post about this topic, even though examples are in v2, information is still relevant.
这篇关于retrive从YouTube API唯一的移动支持视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!