How can I display a video without host thumbnails and autoplay it on page loading in Webflow?

Published on
September 22, 2023

To display a video without host thumbnails and autoplay it on page loading in Webflow, you can follow these steps:

  1. Add the Video Element: In your Webflow project, go to the page where you want to display the video and drag and drop a Video element onto the page.

  2. Set the Video Source: Click on the Video element and go to the Settings panel on the right-hand side. Under the Video Source section, click the "Upload Video" button to upload your video file. Make sure the video format is supported by modern browsers (e.g., MP4, WebM).

  3. Disable Thumbnails: By default, Webflow will generate a thumbnail for your video. To disable this, go to the Design panel for the Video element, scroll down to the Thumbnail section, and uncheck the "Show Thumbnail" option.

  4. Autoplay the Video: To have the video autoplay when the page loads, you'll need to add custom code to your project. Go to the page settings by clicking on the gear icon in the top-left corner of the Designer, and then select the "Custom Code" tab.

  5. Include the JavaScript: In the "Head Code" section, paste the following JavaScript code:

<script>  window.addEventListener('DOMContentLoaded', (event) => {    const video = document.querySelector('video');    video.play();  });</script>
  1. Publish and Test: Save your changes and publish the site. Open the published site and navigate to the page with the video. The video should now autoplay without showing any host thumbnails.

Please note that some browsers restrict autoplaying videos to provide a better user experience. In these cases, the video will need user interaction (e.g., clicking) to start playing.

Additional Questions:

  1. How can I customize the appearance of the Video element in Webflow?
  2. Can I add multiple videos to a single page in Webflow?
  3. How can I add captions or subtitles to a video in Webflow?