Bases: Cards view ability to render youtube video still or twitter image embed

something that would immediately increase the usability of the card view is the ability for the chosen “image” property to support web links such as youtube or twitter.

Use case or problem

As an example lets say I have a vault that documents posted videos and tweets online, perhaps also including normal web pages. utilizing the bases plugin to navigate these files with some visuals from each site without having to go through and manually download images or videos from each would be a godsend, currently the most that is supported is embedding that content through their web link.

Proposed solution

utilizing some of the pre-existing mechanisms for embedding web content in markdown files behind the scenes, allow for the displayed image of the Card view to instead display the relevant image or video of a web link.

with regards to videos, actively playing it isn’t something I can see as being relevant in card view unless it is a gif or a raw video file like .mp4 unlike say youtube, where the title thumbnail is more relevant to identification.
for sites such as twitter which can be embedded in markdown files, I would find the image or video of the tweet the focus that would be displayed in the card, perhaps only the first image of the tweet if it has multiple.

Current workaround

Right now I have two approaches I am considering, mainly for the twitter links, one is to put together some python that when supplied a list of addresses would retrieve content from each and find the relevant images before downloading them but that still requires manual attachment to each note after downloading them.

the other approach is to figure out some JavaScript that might? be able to interact with the embed within obsidian and upon pressing a button would supply the URL to the raw media within that embed (such as the images) that could then set the relevant “image” property of the document it is in.

1 Like

Addendum
Relevant talk about being able to do something similar in dataview queries since iframes are supported in that plugin, later it is mentioned that support for iframes in the Card image has not been explicitly stated as on the roadmap yet which could be a possible route to take for allowing the above.

For YouTube, use Featured Image.

2 Likes

Nice find peeragetalkers. This may be the work around until Obsidian build into Core

funny you mention that, I submitted a feature request to them not too long ago, before I knew about bases, to add compatibility with grabbing images from twitter/social media but they said it was too difficult without including several other libraries in the plugin :frowning:

I could see how including the iframe would be difficult.
The featured image plugin essentially is just pulling in a .webp image when you add ![YouTube Video](https://youtube.com/videoid) which is added to your frontmatter.

The Cards Layout recognises this format and displays the static thumbnail

For now I think I will use it as a work around. Result

Especially with YouTube breaking iframes in Obsdian since the end of September