When working with user-generated content, it's important to note that YouTube channels may restrict their videos from being played in an embedded player. In order to provide a better user experience, I need to detect the specific reason why a video can't be embedded rather than just knowing that it won't play. This way, I can inform the user before attempting to load the video into the player.
I'm curious if there is a way to retrieve this information through a v3 data query similar to the one I am currently using:
$.getJSON('https://www.googleapis.com/youtube/v3/videos?key=***&part=snippet,contentDetails,statistics&id=' + videoID, function(data, status, xhr) { ...
I came across some discussion on this topic related to the v2 data API here.
Is there a method to proactively check if a video is restricted from being played as an embed prior to attempting to load it?