There are a few different methods to display videos on your website. Today, we’ll discuss how to do it whether you’re on WordPress or not. We’ll also cover embedding video from a third-party service like Youtube and Vimeo versus uploading and displaying video from your hosting provider.
Downsides of hosting video yourself.
At first, you might be tempted to upload your video to your website hosting and try to embed it from there. While this can be done on many hosting providers, you will quickly find it’s not that easy. And it might not work the way you expect it to.
Uploading large video files to your website can not only take forever but they could be denied by the hosting provider due to upload size and timeout limits. Services like YouTube have hundreds of fast and efficient servers built specifically for uploading and hosting videos. That’s all they do. According to 2018 stats, over 300 hours of YouTube videos are uploaded every minute!
Streaming video files that have been uploaded directly to your site are at the mercy of your host’s server resources and bandwidth. If you have multiple people watching your video at once, it can slow or even crash your website due to exhausting those resources. Streaming services have the capacity and bandwidth to allow unlimited video watching. Around 5 billion videos are watched on YouTube each day.
One video format, codec, size, and resolution does NOT fit all applications and devices. Your MP4 video might not work well for some, and it might not display at all for others. Streaming services re-encode your uploaded video to several different formats and resolutions. That’s why the processing stage takes so long for some videos. They then serve the right video to the user based on their viewing device and internet speed.
So, let’s say that you could convert your video to several different formats and serve the right one. Video also takes up a lot of disk space. This can be a lot less cost-effective to host on your web host, particularly if you have a quality host with high levels of backups and redundancy (meaning you pay more for disk space).
Video hosting services exist and thrive because they solve these problems. They also give you access to additional features such as analytics detailing how long your viewers watch your videos.
YouTube deserves special attention because it’s the largest video hosting service in the world and the second-largest online search engine in the world. It’s also extremely easy to use and FREE!
There are some downsides to using providers like YouTube but most people are ok with them. Like…
Ads – YouTube generates revenue by advertising, whether they be pre-roll or banner ads at the bottom of videos. Most of the time, they won’t show unless you have some specific settings enabled though. Vimeo has a paid / premium account option that gets rid of ads and allows protected streaming if they bother you too much.
Related Videos – Many embedded videos will show a thumbnail grid of related videos after your video has been completed. An algorithm chooses these videos based on context and relevancy, so a video might show up that you don’t want to. There are some options available though that allow you to turn these off or display other videos that you own within your channel (provided you have them).
Regardless of these downsides, with both free and paid options available, there isn’t really a need to host your video on your web host.
How to embed a third-party service video
Within WordPress, adding a video has become as simple as pasting the video’s URL into a post or page. All you need to do for this is copy the video URL from the address bar and paste it into the visual editor. WordPress has built-in embed functions that take a known provider’s URL and convert it to an embedded video player, without you having to do anything else. WordPress supports this functionality for many popular providers such as YouTube, Vimeo, Twitter, and more. For a full list of supported sites, visit the WordPress Embed Codex.
While this is the easiest way to embed a video, you don’t get any options for how it should be sized and positioned. The mobile responsiveness can leave a bit to be desired also depending on your theme.
For a little more control, use a shortcode or editor block with additional settings that allow you to stylize the video and placement to your liking. Typically, these will include options for showing a dark/light player, hiding related videos, and more.
If you don’t use WordPress, then you can always choose the embed options found inside any of these third-party services. Typically, these are iframe codes. Be careful with this embed method because the iframe codes will not be mobile responsive by default. They have explicit width and height values set in the parameters and these will not automatically adjust depending on the device a user could be watching from. To make the videos responsive to all devices, you must do a little more code work wrapping the iframe within a responsive DIV element and that might not be easy for those not familiar with HTML and CSS.
There are custom solutions available out there that offer video hosting, video conversion for all devices, a content distribution network to serve files fast from everywhere (like Amazon Cloudfront), and completely custom video players that allow for pre-rolls and whatever else you can think of. But, you’ll pay heavily for the service, and the developer needed to ensure things run properly across the board. This is why we highly suggest an existing third-party service, whether free or paid. You’re more likely to get custom pre-rolls and a custom player option using a paid service.
We’ve talked about the downsides of uploading video to your website server in how those videos can take up lots of space and exhaust your server resources to slow or even crash your website. This is what makes a third-party video service the clear winner on how to display video for your website visitors.
I should also mention that the same can be said for large audio files as well. They also take up lots of resources to play. This is why we advocate that you use a streaming service for those as well like SoundCloud or a podcast provider.
In the end, keep in mind that the right solution exists to keep your website ripe with great content while never slowing your visitors down. We would love to help you with that. Reach out to us.