0

ウェブページに YouTube ビデオを埋め込む場合、jquery/javascript を使用してビデオがダウンしていることを検出できますか (著作権またはユーザーがビデオを閉じるため)。

助けてくれてありがとう。

4

1 に答える 1

0

YouTube Data API v3 を使用して、javascript で動画データを取得できます。

https://developers.google.com/youtube/v3/docs/videos

ビデオデータを取得しようとして、ビデオが存在するかどうかを確認できます。

https://developers.google.com/youtube/v3/docs/videos/list

ビデオ データを取得した後、次のフィールドを検証できます。

contentDetails.regionRestriction

The regionRestriction object contains information about the countries where a video is (or is not) viewable. The object will contain either the contentDetails.regionRestriction.allowed property or the contentDetails.regionRestriction.blocked property.

contentDetails.regionRestriction.allowed[]

A list of region codes that identify countries where the video is viewable. If this property is present and a country is not listed in its value, then the video is blocked from appearing in that country. If this property is present and contains an empty list, the video is blocked in all countries.

contentDetails.regionRestriction.blocked[]

A list of region codes that identify countries where the video is blocked. If this property is present and a country is not listed in its value, then the video is viewable in that country. If this property is present and contains an empty list, the video is viewable in all countries.
于 2013-10-30T13:59:44.850 に答える