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