Fallback for oEmbed content

Probably impractical. When you do not control the content you can not know if it will be embedable at the time of viewing. Easiest example of why it might be hard in the context of youtube/vimeo is videos that can become restricted, either private or geo restricted.
In that case the content is still embedable but the user sees some kind of “this content is restricted” message. At this case you might want to show you alternative content, but it is impossible to detect such an event on wordpress side. Youtube has JS API which might give you relevant indications, but not all service providers has such an API (wordpress oembed server part of the code do not have such a thing AFAIK)

You can detect content removal by trying to execute the oembed protocol once every several days for all posts, but assuming that there is no scaling problem to do that, what will you exactly do when an oembed fails? you can not replace a video or a song with alternative content, and using an instagram image from your server is a copyright violation.

If you are worried about such a thing, do what CNN does when they embed tweets where they copy the text of the tweet as part of their content, in other words – if you have an alternative content, just use it on the side of the embedded one.

Leave a Comment