retrive only mobile-supported video from YouTube API

只谈情不闲聊 提交于 2019-12-18 09:26:40

问题


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

So, there is a way to filter that videos? I read this doc but did not find a solution.


回答1:


There are two concepts embeddable and syndicated. iOS devices use iframe so they basically embed. Android devices that use player API can check syndicated.

When you do a search->list, you can set videoEmbeddable and videoSyndicated to true.

For Android, you should check videoSyndicated.

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.

Here is a blog post about this topic, even though examples are in v2, information is still relevant.



来源:https://stackoverflow.com/questions/19003041/retrive-only-mobile-supported-video-from-youtube-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!