I want to show a Youtube video inside a blog post. It works great while editing, but as soon as I view the post on my website, I no longer see the media preview.
Video Shows on the admin page
Nothing shows in viewing mode. It appears that the elements are there, but they don't render
Steps to reproduce
1 - Copy a link to a Youtube video (such as https://www.youtube.com/watch?v=C5M2cy80LxE )
2 - Paste this link into the editing area or using the 'Media Embed' tool within ckeditor 5
3 - Video preview shows as expected in the editor
4 - View the content outside the editor (like a user would)
No preview is shown
Research
I found this SO thread that suggests adding "previewsInData": "true" to the config, but this didn't work for me.
By default, the media embed feature produces output that does not contain previews of embedded media, called the semantic output. This means that you need to transform the output elements into real media on your target website.
There are many ways to do that. The simplest, plug-and-play solutions are described here. You can also implement this transformation as part of your back-end service or you can use different services than described in this section.
The docs then go into various ways to accomplish this, one being adding Iframely.
Ideal behavior
Media embeds (such as Youtube videos) render in viewing mode.
Context
I want to show a Youtube video inside a blog post. It works great while editing, but as soon as I view the post on my website, I no longer see the media preview.
Video Shows on the admin page
Nothing shows in viewing mode. It appears that the elements are there, but they don't render
Steps to reproduce
1 - Copy a link to a Youtube video (such as https://www.youtube.com/watch?v=C5M2cy80LxE ) 2 - Paste this link into the editing area or using the 'Media Embed' tool within ckeditor 5 3 - Video preview shows as expected in the editor 4 - View the content outside the editor (like a user would) No preview is shown
Research
I found this SO thread that suggests adding "previewsInData": "true" to the config, but this didn't work for me.
According to the Ckeditor 5 docs
The docs then go into various ways to accomplish this, one being adding Iframely.
Ideal behavior
Media embeds (such as Youtube videos) render in viewing mode.