How can I embed a youtube video with markdown? #4580
Replies: 8 comments 26 replies
-
Beta Was this translation helpful? Give feedback.
-
|
Do you have similar advice to embed video from Google Drive ? |
Beta Was this translation helpful? Give feedback.
-
|
I am unable to get this to work for some reason on my server. All youtube embeds just don't show up. I put your code not only in the HTML inject but in the seperate page as well to see. Nada. Any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
-
|
please delete |
Beta Was this translation helpful? Give feedback.
-
|
There's a much easier way to do this Add the following to where you want the iframe to load on the page, wiki js will give it an id of Then click on page, click on scripts, here you can define the page script for each page <script>
window.onload = function() {
document.getElementById('youtube-video').outerHTML = '<iframe width="100%" height="550" src="https://www.youtube.com/embed/Q-0T3uA225Y?si=golv8OHBelfG_mXq" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>';
};
</script>Add this code into the script. Replace the URL with your youtube's URL |
Beta Was this translation helpful? Give feedback.
-
|
Версия кода для работы с RuTube: Переопределение CSS (Без изменений): А вот внедрение в HTML: |
Beta Was this translation helpful? Give feedback.
-
|
If you enable If using YouTube as your video source, they generate the iframe tag for you if you go to Share > Embed |
Beta Was this translation helpful? Give feedback.
-
|
I can confirm if you do this, you can use embeds for YouTube:
In order to use this, you need to convert your page to raw HTML. For most people this may a bridge too far, but it's pretty simple to learn. When the page has been converted to HTML, you can then go to the YouTube video you wish to embed, press Share, then Embed and there's some code for you to copy and paste in there. Save the page, and it should render. If the video says "Watch on YouTube" they have turned off embedding (usually cos adverts). |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
Anybody can help me how I can embed a youtube video with markdown in wiki.js?
Thanks!
Marc
Beta Was this translation helpful? Give feedback.
All reactions