Skip to content

Flatpages_add_videos

henrinie edited this page Jun 8, 2018 · 2 revisions

How to add videos to Flatpages (content pages)

First of all you need to open the edit page for the Flatpage you want to edit. See Edit and create Flatpages for instructions.

The recommended way

In the page editor for the desired language, enter the code editor by pressing the button that looks like </> django-admin_flatpages_add_video.png Use this HTML-code as a template for adding a video:

<video preload="metadata" controls="" muted="" poster="/path/for/poster-image.png">                         
<source src="/path/for/mp4-video.mp4" type="video/mp4">
<source src="/path/for/webm-video.webm" type="video/webm">
Your browser does not support the video tag.
</video>

Replace /path/for/poster-image.png with the relative path to the file, or the full url like https://example.com/poster-image.png Replace /path/for/mp4-video.mp4 with the relative path to the file, or the full url like https://example.com/mp4-video.mp4 Replace /path/for/webm-video.webm with the relative path to the file, or the full url like https://example.com/webm-video.webm

The easy way (not recommended because it messes up the HTML-code)

Select the spot where you want the video to appear at. Copy the url of the video and press the button that looks like a video camera. Paste the url into the box that opens. django-admin_flatpages_add_video_via_button.png