Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

YouTube embed gives "restricted from playback on certain sites" error despite API metadata indicating otherwise

I am trying to have my client application filter out videos that do not allow embedding. My understanding here is that there is no way to limit the feed (i.e. format=5 is insufficient) to do this and that I must check the properties of the entry myself, for the <yt:accessControl> tag and the <app:control> and <yt:state> tags.

This isn't working for me.

For example, this video: https://www.youtube.com/watch?v=waxat-_tRH8

doesn't embed: https://www.youtube.com/embed/waxat-_tRH8

even though the API returned data indicates (as far as I can tell) that it should be able to embed: https://gdata.youtube.com/feeds/api/videos/waxat-_tRH8?v=2

The entry does not contain any <yt:noembed> tag (see prior question) and the <media:restriction type='country' relationship='deny'>ME DE RS</media:restriction> does not explain this since I am in the US (see prior question) (see prior question).

What am I missing here?

EDIT: The embed link above works in my web browser, but not in my client app's WebView....!?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Certain videos have a domain-level whitelist or blacklist applied to them. This is done at the discretion of the content owner.

If there is a whitelist or a blacklist, and the domain of the embedding site can't be determined (perhaps because of there not being a real referring domain in the case of your native application), then the default behavior is to block playback.

This blog post has a bit more detail as well: http://youtube-eng.blogspot.co.uk/2011/12/understanding-playback-restrictions_28.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...