player.tech_.hls with player.tech_.vhsIf you have been developing HTML5 video players using Video.js, particularly those handling HTTP Live Streaming (HLS), you have likely encountered a warning in your browser's console that looks something like this:
VIDEOJS: WARN: player.tech_.hls is deprecated. use player.tech_.vhs instead
At first glance, this warning can be alarming, especially if your custom player logic relies on accessing the underlying HLS technology. Is your player about to break? Do you need to rewrite large portions of your codebase? Resolving the Video
The short answer is: No, your player will continue to function for now, but you should update your code to future-proof your application.
This article provides a deep dive into why this warning appears, what player.tech_.hls and player.tech_.vhs actually represent, how to fix the issue, and best practices for managing Video.js tech instances moving forward. VIDEOJS: WARN: player
.hls in your code?Don’t panic. The warning could be coming from:
Try updating Video.js and http-streaming to the latest versions: At first glance, this warning can be alarming,
npm install video.js@latest @videojs/http-streaming@latest
The VHS API is designed to be mostly compatible. Commonly used properties/methods:
.hls.playlists → .vhs.playlists.hls.master → .vhs.master.hls.selectPlaylist() → .vhs.selectPlaylist().hls.representations() → .vhs.representations()In most cases, it’s a straight rename.
Because the underlying object is the same, most methods will work identically. However, double-check any methods specific to the old contrib-hls. The VHS API is largely compatible but not 100% identical.