Video Optimization for the Web: The Missing Piece in Lighthouse

Bookmark
Rate this content

Video is everywhere on the web, from hero banners to product videos to full-blown streaming. However, while Lighthouse reports issues related to images, scripts, and more, it doesn't really address video performance. That means streaming can suffer for end users, resulting in buffering and slow starts, while businesses incur huge data transfer costs due to unoptimized delivery.

In this lightning talk, we'll explore some quick wins every developer should know: optimizing video size and format, optimizing streaming for every device and network, and different video loading strategies to improve performance. In just seven minutes, you'll leave with a toolkit to make your videos load faster, play smoother, and feel as polished as the rest of your app, closing a significant gap that performance audits often overlook.

This talk has been presented at React Summit US 2025, check out the latest edition of this React Conference.

FAQ

ImageKit is known for image and video optimization for web and mobile applications.

ImageKit can automatically convert videos to the right format, compress them, and optimize them for different network conditions using adaptive bit rate streaming.

ImageKit supports modern video formats like WebM, VP9, and AV1 codecs for optimization.

ImageKit applies similar audits used for images on short videos, such as compressing, reducing bitrate, resizing, and lazy loading by waiting for user interaction.

Longer videos can be optimized by adapting to changing network conditions and player size, using settings like adaptive bit rate streaming and adjusting resolution based on player dimensions.

Adaptive bit rate streaming is a method that allows video quality to adjust dynamically based on the user's network conditions to ensure smooth playback.

Video player size affects optimization by requiring the player to adjust the video resolution based on the current size, such as switching to higher resolution in full screen.

Pausing a video when it's not in view prevents unnecessary data transfer costs and improves user experience by reducing data usage.

Data transfer costs can be reduced by up to 90% with effective video optimization techniques.

You can learn more about video optimization from ImageKit by watching their detailed YouTube video or visiting their booth at ImageCadent.

Rahul Nanwani
Rahul Nanwani
7 min
18 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Rahul introduces video optimization principles, emphasizing modern formats, compression, bitrate reduction, and lazy loading. ImageKit simplifies video loading by compressing videos significantly and adapting to network conditions. Pausing videos when not in view saves data costs and enhances user experience.

1. Video Optimization Principles

Short description:

Rahul introduces video optimization for websites and apps, emphasizing the use of modern video formats, compression, bitrate reduction, and lazy loading for optimal performance.

Hey, I'm Rahul, great to be here. I'm one of the co-founders at ImageKit. And when we bought this domain name ImageKit 10 years back, we thought we were only going to be doing images as a product, right? But here I am talking about video optimization for the web because that's like the next big media format that almost everyone is using on websites. And though seven minutes is a really short time to be talking about video optimization, but I'll try to leave you with some guiding principles and maybe some methods in which you can optimize videos for your websites and apps, right? So let's get started.

Lighthouse is great. If you want to test for your website for performance, it's great for images, but it's not great for videos, right? For images, it gives you all kinds of audits, like whether it's in the right format, whether it's compressing well, whether it's resized, whether it's lazy loading. But for videos, the best thing that you will get out of Lighthouse is that you're loading a large payload, right, which is as generic as it gets. So it really doesn't work for video streaming optimization. So, which brings me to principle one, if you have to optimize your videos for your website, if you have a lot of short videos, and when I say short videos, these are typically under 15 seconds, then you need to apply the same set of audits that Lighthouse does for images to your videos as well. But it would be the video equivalent of it, right? So when we say that you need to use modern formats for videos, you need to use WebM or VP9 or AV1 codecs. You need to compress the videos, reduce their bitrate, reduce their resolution, and lazy load the videos, which in a way to lazy load videos could be that you just wait for the user to play the video.

2. Optimizing Video Loading and User Interactions

Short description:

ImageKit simplifies video loading and optimization, compressing videos significantly. For longer videos, adaptation to changing network conditions and player size is crucial. Pausing videos when not in view saves data costs and improves user experience.

Now, this sounds complex, but with something like ImageKit, because I am from ImageKit, it's actually as simple as just loading your videos via ImageKit, right? So the example that you see on the screen right now, I have a video file. ImageKit automatically takes care of converting it to the right format and compressing it based on the end user's device. And you can add this parameter width 400 to the video URL, and in real time, you'll resize the video to that resolution, right?

Now, this works great for short videos, but here's the catch, right? So, okay, I missed one slide. By doing this, you would be able to compress your videos by close to 90, 95% for the shorter videos, right? But when it comes to longer videos, because the videos stream and load over a period of time, you need to optimize for the changing conditions that would change over a period of time, right? It's, let's say, if you're loading a 20-minute episode on your website or on your app, the time that it takes to download and stream all of that video, a lot of things can change, right?

Now, network is not the only thing that will change as the user plays the video, right? The other thing that changes is that the user could actually change the player size as well. They could go full screen. Let's say they start off in portrait mode, they're viewing the video in a really small placeholder and then they decide to go full screen. You need to allow your player to be able to adjust the resolution based on the size of the video player at that time, right? And now this is not related to ImageKit, but in general, every player would have similar settings. I'm using Video.js here, so you can have two settings, which is limit rendition by player dimensions and use the device DPR.

The last thing, the user would not interact with your video in the same way as they did when they started on the page, right? So for example, your user lands on the page, they start looking at a video, they start playing that video, but it's fairly possible that they just scroll past the video. They start going through the rest of your content. They are no longer looking at the video. If you do not pause the video in such a case, the video player will just keep loading more and more video content, which as a business is a lot of data transfer costs that you would incur. And the user actually gains nothing out of this because they're not really viewing the video at all.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Video Editing in the Browser
React Summit 2023React Summit 2023
23 min
Video Editing in the Browser
Top Content
Watch video: Video Editing in the Browser
This Talk discusses the challenges of video editing in the browser and the limitations of existing tools. It explores image compression techniques, including Fourier transform and Huffman encoding, to reduce file sizes. The video codec and frame decoding process are explained, highlighting the importance of keyframes and delta frames. The performance bottleneck is identified as the codec, and the need for specialized hardware for efficient video editing is emphasized. The Talk concludes with a call to create a simplified API for video editing in the browser and the potential for AI-powered video editing.
Pushing the Limits of Video Encoding in Browsers With WebCodecs
JSNation 2023JSNation 2023
25 min
Pushing the Limits of Video Encoding in Browsers With WebCodecs
Top Content
Watch video: Pushing the Limits of Video Encoding in Browsers With WebCodecs
This Talk explores the challenges and solutions in video encoding with web codecs. It discusses drawing and recording video on the web, capturing and encoding video frames, and introduces the WebCodecs API. The Talk also covers configuring the video encoder, understanding codecs and containers, and the video encoding process with muxing using ffmpeg. The speaker shares their experience in building a video editing tool on the browser and showcases Slantit, a tool for making product videos.
Going Live from a Browser...with Another Browser
JSNation Live 2020JSNation Live 2020
8 min
Going Live from a Browser...with Another Browser
This Talk discusses live chat and live broadcast using WebRTC and RTMP. It explores running WebRTC on a server via Chrome and alternative approaches like using GetUserMedia and the Chrome.tabCapture API. The use of a whole Chrome instance for WebRTC and RTMP broadcast is also discussed, highlighting the pros and cons of this approach. The Talk recommends checking out Nick's talk from All Things RTC for more information.
Creating Videos Programmatically in React
React Summit Remote Edition 2021React Summit Remote Edition 2021
34 min
Creating Videos Programmatically in React
The Talk discusses the use of ReMotion, a library that allows for declarative video creation in React. It covers the process of creating videos, animating elements, and rendering multiple compositions. The Talk also mentions the features of ReMotion, such as audio support and server-side rendering. ReMotion 2.0 introduces audio support and the possibility of live streaming. The Talk concludes by highlighting the frustration with existing video editing tools and the integration of existing videos into ReMotion projects.
Going Live from your Browser without WebRTC
React Summit Remote Edition 2020React Summit Remote Edition 2020
13 min
Going Live from your Browser without WebRTC
Mux provides an API for live streaming and aims to keep users in their own applications. Live broadcast and live chat are different, with live chat using WebRTC and live broadcast using RTMP and HLS. WebRTC can be implemented using headless Chrome or the getUserMedia process. Mux targets developers building platforms and suggests using semantic HTML. Ionic supports native apps and custom native views.
Getting Weird with Video Manipulation and HTML5 Canvas
React Summit 2020React Summit 2020
16 min
Getting Weird with Video Manipulation and HTML5 Canvas
Today's Talk at React Summit focused on the Canvas and HTML5 video APIs, showcasing the capabilities and possibilities they offer for video manipulation and interactivity. The speaker demonstrated how to use the HTML5 video element and canvas to manipulate and draw images, apply filters, and add real-time text overlays. They also showcased real-time object detection on video frames using machine learning. The Talk concluded with an example of enhancing a marketing website with interactive video using the canvas element. Overall, the Talk highlighted the power and potential of these APIs for video development.

Workshops on related topic

Build Your Own Live Streaming Platform
React Summit Remote Edition 2021React Summit Remote Edition 2021
138 min
Build Your Own Live Streaming Platform
Workshop
Dylan Jhaveri
Dylan Jhaveri
In this workshop we will go over the basics of streaming video over the internet including technologies like HLS and WebRTC. We will then build our own React app to play live streams and recordings of live streams.