FHachez / obsidian-convert-url-to-iframe

Plugin for Obsidian.md to convert a selected URL to an iframe.
200 stars 17 forks source link

use `oembed-parse` to get the iframe from the source (Youtube, Soundcloud etc) WIP #34

Closed FHachez closed 2 years ago

FHachez commented 2 years ago

Instead of doing a custom mapping to embed for YouTube, we now rely on the OEmbed standard. Thanks to https://www.npmjs.com/package/oembed-parser .

It doesn't work for all the sites, and we fall back to the old behavior if we cannot get the provider's iframe.

Note: Spotify doesn't work well because of CORS. Even though technically, it should be solved https://community.spotify.com/t5/Spotify-for-Developers/OEmbed-API-missing-CORS-headers/td-p/5225343

TODO