zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

[feature request] Embeding youtube/vimeo videos? #2051

Open cptvincer opened 3 years ago

cptvincer commented 3 years ago

I found out it was possible (even automatic) before. Is there any way/workaround for doing it now? iframe doesnt work.

I think it would be best for embeding pasted links to be a setting or option upon paste

zadam commented 3 years ago

The functionality you talk about (discussed in #564) does not unfortunately work as one would expect. The embed plugin will "embed" the video into the content but it's not clickable, you can't start it - you can try yourself here.

I guess what CKEditor team had in mind when developing this plugin was the use case where you embed the video in some CMS, the page gets published as readonly HTML where website visitors can play it. But that's not true for Trilium's use case.

cptvincer commented 3 years ago

Oh now i get it. Sad tough.

Is there any way to force the note to render an iframe? or just the area where the embed would be?

seconddayout commented 2 years ago

👀 Marco…

b-jordanov commented 5 months ago

I'm also interested in this. I'm trying to find a decent wiki storage for my stuff and just installed Trillium a few hours ago. I don't mind the video not playing as long as I can right/left click on it and get the link, but this visual representation inside "walls of text" really helps the brain figure out what comes after what and navigate in a more efficient way.

Same goes for the images. I figured out that images cant be just cropped from the screen and easily pasted from the clipboard which is kind of sad.

meichthys commented 5 months ago

Same goes for the images. I figured out that images cant be just cropped from the screen and easily pasted from the clipboard which is kind of sad.

They can't? It works for me as expected in the latest version. Screenshot an image, ctrl-v in trilium. and image is displayed/saved.

meichthys commented 5 months ago

For videos, you can use the markdown import option (on the block editor toolbar) to display a youtube video thumbnail which, when clicked, takes you to the youtube video.

For example, you can pase in this as a test: [![Everything Is AWESOME](https://img.youtube.com/vi/StTqXEQ2l-Y/0.jpg)](https://www.youtube.com/watch?v=StTqXEQ2l-Y "Everything Is AWESOME")

b-jordanov commented 5 months ago

Same goes for the images. I figured out that images can't be just cropped from the screen and easily pasted from the clipboard which is kind of sad.

They can't? It works for me as expected in the latest version. Screenshot an image, ctrl-v in Trilium. and image is displayed/saved.

Thank you for the fast response! I honestly didn't test it with the KDE Plasma native screen capture. It works 10/10. Most of the time I use Flameshot -> copy to clipboard, which normally works with other programs like Telegram/Firefox out of the box.

For example, you can paste in this as a test: [![Everything Is AWESOME](https://img.youtube.com/vi/StTqXEQ2l-Y/0.jpg)](https://www.youtube.com/watch?v=StTqXEQ2l-Y "Everything Is AWESOME")

This is awesome! Thank you so much! There's one last thing I'm trying to figure out. I see that code blocks don't support syntax highlighting and that's ... let's say I can live with it, because notes do. But is there any easy way to create a code block so that when I click on it, automatically selects the whole text inside the block and copy it to the clipboard?

I use a lot of Linux commands, and normally I would write scripts, but I'd be happy to share my wiki docs with others, and some times it's a breeze to just copy the whole thing inside the code block. If you don't mind pointing me to the files related to this, I might write some custom code to achieve the functionality.

meichthys commented 5 months ago

I think what you want to do is move your code to a code note instead of a code block, then you can use the "include note" feature to display the code note inside your other note. As for copying the code, that has been requested a lot and I think it is a ckeditor limitation last time I checked.