blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

[Feature Request] Embed and resize local media (audio, video, image) in a dataview query #864

Open Elaws opened 2 years ago

Elaws commented 2 years ago

Hello,

Not sure if this depends more on Obsidian or Dataview, but currently local media can’t be embedded in a dataview table.

It would be great if media could be embedded and resized in dataview queries, especially local audio files, and importantly using relative paths inside vault.

Thanks !

blacksmithgu commented 2 years ago

I have no idea how the audio player works, to be honest - is it just a file embed that shows up as a playable thing?

Elaws commented 2 years ago

Thanks for your quick reply @blacksmithgu !

Here is what the audio player looks like :

image

I just noticed that no local media can be embedded in a dataview query (images, videos or audio), so I've edited this feature request to include them.

Elaws commented 2 years ago

@blacksmithgu : Here is the link of that FR on Obsidian's forum, just in case it does not rely exclusively on Dataview.

If not, I can delete the FR on Obsidian's forum, and keep only this one here.

blacksmithgu commented 2 years ago

This one is a little complicated, mainly because it's up to the Obsidian API to support rendering these blocks inside of plugin-rendered Markdown. I will make an API request to see if it is feasible.

Elaws commented 2 years ago

Thank you @blacksmithgu , looking forward to hearing news on that FR ! ;)

darrenkuro commented 2 years ago

Similarly to this issue, it works fine for me if insert DOM manually when querying, regarding audio, it'd be <audio controls src="app://local/${this.app.vault.adapter.basePath}/${this.app.vault.config.attachmentFolderPath}/${dv.current().audio}"> </audio> But some sort of native support with embed would be awesome! DOM code in MD file is a pain to look at.