Better performance video when low bandwidth

Does JavaScript have features that can make large video files play better on mobile device and devices that have low bandwidth? Can Node.js be helpful with this? Thanks

Large, as in file weight, and low bandwidth do not go well together.

The only way that might be an improvement is streaming. All the bits and bytes will still use bandwidth, no way around that. But the user will not need to wait for the entire file to transfer before they can start watching it.

AFAIK JavaScript can do “lazy loading” of images on an “expected need” basis, but not for single large video files.
Maybe you could break up the file into a series of smaller files?

1 Like

If with “play better” mean “load faster”, then I wouldn’t know how. As @Mittineague said, streaming or chunking the files could make them appear to load faster since you don’t have to wait for the entire file to be loaded, but this won’t magically increase download speed, of course.

What you could do however is to provide an appropriately downscaled version of the video, which will be loaded by default. Then on client side get the viewport size with document.documentElement.clientWidth and document.documentElement.clientHeight respectively, and if it’s not a mobile viewport, send a request to the server to get the larger resolution video instead.

Both of your explanations are good, thanks… I made a mistake and said low bandwidth I meant high bandwidth. Sorry for the mistake. How does Youtube make video play so seamlessly on devices with even slow connection… That’s kind of an example of what I am trying to understand. What @Mittineague said sounds interesting, I want to know if the breaking up is a thing I would rely on JavaScript for or what is a good way. I will research the AFAIK stuff. I will also research the downscale-ing you speak of. Thanks

Actually the way I worded the question (the original) was correct the device has low or slow bandwidth and the file is large. Sorry for all the confusion. Anything anybody knows about would be helpful. Thanks

I don’t think actual “performance” eg cpu speed of the device is relevant, it’s bandwidth. I agree that serving a downgraded version of the media is likely the most effective solution.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.