TL;DR
<video>
tag for self-hosting and more control.Hosting Options
When embedding videos on websites, choosing the right hosting option is crucial. Self-hosting using the <video>
tag provides more control over playback options and avoids third-party branding [2:4]
[3:1]. However, it requires careful management of bandwidth and server resources, especially for high traffic sites
[4:3]. Vimeo Pro is often recommended for professional-looking embeds without ads, though it can be expensive
[2:5]
[5:3]. GitHub hosting might violate their terms, so alternatives like AWS are suggested
[5:5].
Video Format and Size
Optimizing video format and size is essential for efficient loading and maintaining quality. WebM is widely supported and typically smaller than MP4, making it a preferred choice [5:1]. For hero background videos, keeping the file size under 2MB and duration under 18 seconds is recommended to ensure quick load times and preserve Core Web Vitals
[5:2]. Compressing videos and caching them properly can also prevent excessive bandwidth usage
[4:7].
Autoplay and Accessibility
Autoplay can negatively impact user experience and accessibility, especially if videos have sound [4:2]. It's generally advised to avoid autoplay unless the video is muted
[5:4]. Additionally, ensuring that text overlays are readable and providing pause controls can enhance accessibility
[5:4].
SEO Considerations
While embedding videos from YouTube does not provide any indexing advantage over other hosts [3:2], self-hosting allows you to use SEO-friendly filenames which might offer slight ranking benefits
[3:1]. Using modern codecs and lazy-loading techniques can help maintain site performance and SEO metrics
[4:1].
Recommendations Beyond Discussions
Consider using a Content Delivery Network (CDN) like Cloudflare Stream for better delivery across different regions. Always test video performance across various devices and browsers to ensure compatibility and efficiency. If your website heavily relies on video content, investing in a robust hosting solution that supports adaptive streaming could significantly improve user experience.
Hi all,
I have a video that I'd like to embed into a business website.
I'm wondering what guidelines you follow to keep the size down, but the quality watchable?
Things I'm looking for are:
Typical resolutions that will still look ok
Typical export settings
Size limits (aka what's too big?)
Remote hosting? Is there a seamless way to embed remotely hosted videos that won't show adverts and that doesn't cost anything?
Also - how do some sites have massive hero videos that manage to look pretty decent? Any articles that you might suggest would be helpful.
Thanks in advance.
Why not use yt and embed that
This is for a business website, ideally I want it to loop with no controls (or custom controls) and I definitely don't want anything else to play or adverts to pop up.
Is that possible with YouTube or Vimeo? I assumed not.
Use Google drive.
how to download embedded video? i tried inspecting and developer tools but they didnt work do you have any idea?
I have a client who wants a video to play on the website, no auto play, what is the best way to implement this? I read about avoiding iframes, is the <video> element the best route? Or is there something new and fancy I'm not aware of yet?
I found the video tag can be wonky, I usually like to Vimeo if the client has an account. It’s the most professional looking and gives you some decent customization options.
Do not auto play unless you want to piss off users.
is vimeo an iframe too?
I believe in most cases it is, but the engineers over at YouTube and Vimeo are good so you won’t run into a lot of issues using them. I agree that Iframes generally suck to work with, but when they are part of an embed script from a major provider they usually aren’t as much of a hassle.
<video> is for self hosted video files, <iframe> would be to embed from somewhere else (youtube, vimeo). For most purposes i would go with self hosted.
Depends on which web builder your using and how you want the video to displayed. Every web builder and custom coded sites allow for embedding a video. This shouldn't effect site speed (Unless you're using YT).
YouTube will show suggested videos to the user and there's no way of removing the YouTube logo from the video player. Vimeo allows you to remove their logo but it's fairly pricey.
Zeacon has been our dev shops go to - our clients love it cause it's fast, white labeled, and increases website visitors + conversions.
I like <video>(self hosted). It gives more control.
is it faster load time to do the <video> option?
That depends on the server.
What's the difference between Iframe elements and Video elements?
Vimeo. Auto play isnt supported by browsers anyway unless you mute the video.
Youtube iframe is rubbish but free and will make the page heavy and increase loading time.
You can get around the loading time by lazy loading the iframe
Questions about video embedding best practices.
I manage a website in the industrial tools niche. Think tools for oil companies, gas, energy, etc.
We do videos explaining some of the best ones, uses, etc.
We've been uploading them to Youtube and embedding them on our site.
Would it be better for us to explore a video embedding service like Wistia (expensive), Vimeo Business, etc?
We would still have the YT channel, just not for embedding. We want to get rid of ads, related videos at the end.
Final question:
Do you think there is an indexing advantage between self-hosted videos vs Youtube?
Should we consider this option as a traffic generator? Youtube won't generate traffic.
In regards to an indexing benefit:
(according to Gary Illyes during a q&a I attended)
There is no indexing or search benefit to hosting videos on YouTube rather than an alternative host.
As for your other questions, someone else will have to weigh in on those.
Have you tried hosting them yourselves with a <video> tag? Try that with a couple of videos and see if that moves the needle in the SEO field.
The advantage of self-hosting it is that you can choose the video file name…
my-long-tail-keyword.mp4
…and that could help a tiny bit in rankings.
My 0.02.
I’ve built many websites with videos, mostly for content like blog posts, but never to an excessive degree. In those cases, additional optimizations for video elements weren’t necessary, as most clients rarely published content with videos. When they did, it was usually just one video with controls, not something that required complex optimization.
However, the current project I’m working on is different: it includes videos as design elements across multiple pages, with five autoplay videos on the homepage alone. While my colleague optimized the videos for duration and file size (about 10MB each), I still have some concerns.
The site is optimized for speed, hosted on a dedicated server, and has videos set to lazy-load. So far, performance has been fine, but I’m starting to question whether this approach is considered a bad practice in web development.
I’ve seen suggestions that embedding videos from other platforms might be better for performance, and while that sounds logical, I prefer hosting them directly and embedding them using the video tag for more control over design and functionality. Given this approach, what key factors should I consider to optimize the videos?
I’d also like to know if the approach of using so many videos per page is generally frowned upon among web developers. In that case, I’ll definitely inform my designer and client and suggest making some changes.
First, be aware of how browsers treat autoplay videos
https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Autoplay
Next, are you prepared for the network bandwidth to support self-hosting videos with five users? 10 users? 100? What is your projected user load? Video can also put a significant load on your CPU, depending on how you manage it.
In most cases, it's going to be best to offload video to a video hosting service
Regarding autoplay across different browsers, I made sure the videos themselves have no audio and use the muted attribute.
However, I haven't tested the autoplay function on all the videos across all browsers yet, so thanks for the heads-up!
So far, there are no issues on Chrome (desktop, Android, and iOS) or Firefox (desktop).
As for the bandwidth consideration, it's so obvious, yet it didn’t even cross my mind! Thanks again, I’ll definitely look into that.
Be aware of iOS pausing autoplay videos when the device is in low power mode. There is no way around this so you should just be aware and always optimize the poster image.
Compress them as much as you can. I think you can compress them more, by using the correct compression settings. Make sure the videos are cached properly and that the catching settings are correct. 10mb per vid is still a lot if each user is pulling 40mb.
Otherwise you are going to get a horrible horrible bill.
you can actually host them on a video hosting service and with a bit of trickery hide the logos.
My colleague, who handled both shooting and editing the videos, ensured they were compressed as much as possible, which I really appreciate. Caching has also been properly optimized. While hosting them on a video service seems like a logical choice, which platforms are generally considered the best option among web developers?
I hope all 5 videos with sound on 😏
Now that you mention it, I’m curious about how the combined audio output would sound, especially on the 'Projects' page, where even more videos are playing. I might even add an Easter egg to enable all the sounds at once—though I’m not sure the client would approve!
If ur customer really wants this madness just ensure that the videos are streamed. With your own server adaptive streaming looks impossible.
They specifically requested it and absolutely love the design and concept. With this project, I wasn’t involved in the early stages and was handed the approved design to start building. If I had been involved earlier, I would have advised toning it down a bit. For now, I’ll focus on offloading the videos elsewhere.
Hosting your own videos gives you more design flexibility, but five autoplay videos on a homepage can start to impact performance, even if they're lazy-loaded and optimized for file size. To improve efficiency, make sure you’re using modern codecs like VP9 or H.265, setting preload=""none"", and offering multiple resolutions through <source> tags so browsers can pick the most appropriate version. Using Intersection Observer to load or play videos only when they’re in view can also make a noticeable difference.
If managing all of that manually becomes too time-consuming, Cloudinary can take care of the backend stuff—automatic transcoding, resizing, and adaptive delivery over a CDN—while still giving you full control over how videos are embedded and displayed. It’s a solid option if you want to keep things custom without compromising on performance.
Hey everyone,
I’m using a fullscreen autoplay background video (23 seconds, muted, looped) in the hero section of my Webflow site. The video is hosted via GitHub and weighs around 20 MB after compression.
I'm trying to find the best way to integrate a background video that:
A few things I’m unsure about:
I’m embedding it using a simple <video>
tag like this:
<video autoplay muted loop playsinline poster="preview.jpg">
<source src="https://raw.githubusercontent.com/.../1920x1080.mp4" type="video/mp4">
</video>
Would really appreciate insights from those who’ve tackled this! Especially if you’ve found a sweet spot between performance and design.
The standard we use at Jolly Web for background ideos is less than 2Mb for hero background videos. Less than 18 seconds. Always use WebM. Lower quality or length of that video until you hit those. Add a layer blur/overlay if it starts looking bad because usually the text you’re using is more important anyways. BG videos in hero’s are meant to help with the vibe of the company. For actual conversion and business practice, they’ve consistently shown to be less conducive for our clients.
use vimeo pro, get the src link to the mp4, use a embed tag with a video tag.
In my experience just don’t use background videos.
They are not user friendly, accessibility friendly unless you add in the pause, and they make the text in front hard to read.
I think self-hosting videos on GitHub goes against their T&C’s. I’d do AWS or Vimeo Pro.
Definitely use webm, it’s widely supported and way smaller than mp4. Also create separate videos for different screen sizes, at least 2, to save bandwidth and download time for mobile vistors
I hired a development team to custom code my website. For the backend development they asked me the following question
Developer: you already have this option in admin panel, just tell me one thing, which format you will use? embedded videos (which will save website load time) or you want to upload mp4 format from backend? please confirm/
Is this true? Because if it wouldn’t really effect load time I would rather upload mp4 myself but if it would save load time than it probably more important
It reduces server load which will result in lower load times, this is why many sites use CDN’s for media content
So would you recommend using Vimeo? Or something else?
In my experience self hosted videos slow load time unless they are very short (a few seconds) . Longer videos take longer to buffer resulting in longer load times.
I just started using the new video option on cloudflare and switched from a self hosted to hosted on their streaming platform. It seems to work well.
Offload your video files / Images to a CDN. Will drastically improve load time.
It helps improve the load speed to use a third-party service, but make sure that it's a good one. Otherwise, you will see that your website pages load slowly again.
If this is a WordPress driven site, you can easily use the preload=”none” variable in the shortcode for remote hosted videos. I'm not sure it works the same for self-hosted.
If it's self-hosted, just add in a lazy-load plugin, and the videos will queue but not load until they come into the viewscreen.
Hey everyone,
I've been struggling with finding the optimal video format and configuration for embedding on a website. I've tried various formats like MP4, WebM, and Ogg, and experimented with different configurations, but I still haven't found the best solution.
Each format seems to have its pros and cons. MP4 is widely supported but sometimes has quality issues or large file sizes. WebM offers good compression but isn't supported everywhere. Ogg... well, let's not even go there.
I'm reaching out to this community to see if anyone has found a combination that works perfectly across different browsers and devices. What do you think is the best format and configuration for a video to be embedded on a website? Any tips or experiences would be greatly appreciated!
Thanks in advance for your help!
What's keeping you from trying WebM with VP9 video and Opus audio?
I'd say support looks quite global - unless you care a lot about iOS users with older devices: https://caniuse.com/?search=webm
Thanks for the suggestion!
I've thought about using WebM with VP9 and Opus, but my concern is compatibility with older iOS devices. Any tips on handling those cases? Is it worth prioritizing WebM despite that limitation?
Appreciate your help!
That really depends on the specific use case.
H.264 video + AAC audio in an MP4 container is indeed globally supported. But if you want to serve video in 2K and 4K resolutions, you need to use a newer, browser-supported video encoding method, because (the much older) H.264 codec will require excessive amounts of bandwidth for higher resolutions than 1080p.
That is also why YouTube only encodes videos above 1080p as either VP9 or AV1 video.
Apple's Safari is the only browser that supports the patented + license-encumbered H.265 (HEVC) video format, and that's not going to change.
AV1 is the newest and most compression-efficient encoding method. But browser support is still limited. For 8K resolutions I'd say AV1 is your only option. Even VP9 won't perform well for 8K content.
I think AV1 (with either AAC or Opus audio) is supported in both WebM and MP4 containers.
VP9 has global support for all newer devices. It is always contained in WebM.
So in other words: Stick with MP4 (H.264) if you don't need higher resolutions than 720 or 1080p. But go with VP9 for 2K and 4K video.
you need a fallback system
I have an 18-second tutorial/ steps video to embed. What should the settings be to export it? What should be the file size? And video dimensions? Video is made in after effects. What settings to choose in the media encoder?
easiest thing is to put it on youtube and embed it then YouTube takes care of encoding, optimization and bitrates/range of resolutions
Use a mobile or social media preset when you export from media encoder
For 18 seconds, just encode the video efficiently (720p @ ~ 5Mb/s) and use a <video> element. If you go the YouTube route, you're forcing users to load ~3MB of js to run youtube's player and analytics. That's more data than the entire 18s video.
Yes. I got it under 900kb after many trials in settings. The video is still crisp. I would not go through youtube.
Congrats! Nice work.
So I have a single YouTube video on my website that is causing my website to take a few additional seconds to load. Currently, I just have an iframe with a link to the YouTube video, is there a better way to do this in order to decrease load times?
You could create a static thumbnail image and put that in place of the video. Use JS to make it so when the user clicks the image it loads the YouTube video/I frame dynamically rather than loading the iframe on page load
Now that is a cool idea. Thanks.
We have a basic code generator here if someone wants to generate the embed code
There are plenty of options that all boil down to lazy loading or loading on some event:
<iframe loading="lazy">
(fairly poor support)IntersectionObserver
Step 1 don't use YouTube
They drive traffic away from your website and towards YouTube.
They can run your competitors ads on your videos
Don't provide any valuable data
We use www.zeacon.com with all our clients. It's great for boosting traffic + conversions
I have a section of my website that I update every week with my latest youtube video.
Does anyone have suggestions as to how I can automate this?
We have these brief video clips that we want to include in our website product pages, but we don't know where we should host the video from. Will it affect the product pages SEO to have the video hosted on YouTube or Vimeo? Is there a preference towards any of these hosting platforms?
We don't really care for the video itself to be traceable we just want to ensure we're not hurting the overall SEO of the product page.
Google owns YouTube, not Vimeo.
Google likes embedded YouTube videos, especially if they're your own.
Also, embedding useful videos can help with user retention on your blog posts and stuff.
Vimeo is fine, but there are a couple issues with it. One of them is the fact that the titles of videos sometimes overlap other stuff within the embed. It's hard to describe but if you embed one of them you'll understand what I mean.
Youtube is the better option.
What matters the most for SEO is user experience. So if you embed for YT it could hurt ux by showing ads or other irrelevant junk like other suggested vids that detract from the focus of your page. Same w Vimeo the embedding seems to offer some ux / design hiccups. For these reasons I typically compress the crap out of the vid myself and host it on my sites server. It gives me the most design / ux control with the least noise. You could also speculate that since Google owns yt they’d favor it, but can’t speak one way or another on that.. do whatever works best for u and the user.
Thanks so much!!
Best practices for video embedding on websites
Here are some best practices for embedding videos on websites:
Choose the Right Format: Use widely supported formats like MP4 for compatibility across different browsers and devices.
Responsive Design: Ensure your video player is responsive so it adjusts to different screen sizes. Use CSS to make the video scale properly on mobile devices.
Use a Reliable Hosting Platform: Consider using platforms like YouTube, Vimeo, or Wistia for hosting your videos. They provide optimized streaming and reduce the load on your server.
Optimize Video Size: Compress videos to reduce file size without sacrificing quality. This improves loading times and user experience.
Include Captions and Transcripts: Adding captions makes your videos accessible to a wider audience, including those who are hearing impaired or non-native speakers.
Add a Thumbnail Image: Use an engaging thumbnail to attract viewers. A visually appealing image can significantly increase click-through rates.
Implement Autoplay with Caution: While autoplay can increase engagement, it can also annoy users. Consider allowing users to choose to play the video instead.
Use Clear Calls to Action (CTAs): If your video has a specific goal (like signing up for a newsletter), include clear CTAs at the end to guide viewers on what to do next.
Monitor Performance: Use analytics tools to track how your videos are performing. Look at metrics like watch time, engagement, and conversion rates to optimize future content.
Test Across Devices: Always test your embedded videos on various devices and browsers to ensure they play smoothly and look good everywhere.
Recommendation: By following these best practices, you can enhance user experience, improve engagement, and ensure your videos effectively contribute to your website's goals.
Get more comprehensive results summarized by our most cutting edge AI model. Plus deep Youtube search.