This happens when the browser supports native HLS (Safari, iOS) and Video.js decides to use the native html5 tech instead of VHS’s MSE fallback. In that case, VHS is not instantiated at all – which is fine. The warning only occurs when the old hls tech is referenced. If you are seeing the warning but vhs is undefined, it means something else in your code (or a plugin) is still trying to access player.tech_.hls . Use your browser’s debugger to find the culprit.
<!DOCTYPE html> <html> <head> <!-- Use at least Video.js 7+ which includes VHS --> <link href="https://vjs.zencdn.net/8.10.0/video-js.css" rel="stylesheet" /> <script src="https://vjs.zencdn.net/8.10.0/video.min.js"></script> </head> <body> <video id="my-video" class="video-js" controls> <source src="https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8" type="application/x-mpegURL"> </video> <script> var player = videojs('my-video'); player.ready(function() // New way: use getTech() and .vhs var tech = player.getTech(); var vhs = tech && tech.vhs; if (vhs) console.log('VHS engine is active'); vhs.on('loadedplaylist', function() console.log('Playlist loaded (VHS event)'); ); else // Fallback for native HLS (Safari) – VHS may not be used console.log('Using native HLS, no VHS instance');
However, relying on deprecated internal properties ( tech_ properties are technically private to the Video.js framework) is risky. When your site or CDN automatically upgrades to the next major version of Video.js, the compatibility layer will be gone. At that point, player.tech_.hls will return undefined , resulting in fatal JavaScript errors that block your video player entirely. To help me tailor the next steps, tell me: This happens when the browser supports native HLS
);
: By renaming the internal property from hls to vhs , the developers avoided confusion when using the same engine to play DASH content. How to Fix the Warning If you are seeing the warning but vhs
The warning videojs warn player.tech_.hls is deprecated. use player.tech_.vhs instead occurs because Video.js has updated its internal handling of HTTP Live Streaming (HLS).
If you are still seeing warnings after updating the code, ensure that you have uninstalled videojs-contrib-hls from your node_modules and are not including its script tag in your HTML. If you are still seeing the warning, could you let me know: What version of are you running? Are you using a package manager (npm/yarn) or script tags ? What other plugins are you using? When your site or CDN automatically upgrades to
The deprecation wasn’t arbitrary. The Video.js core team and contributors have been working on a major architectural improvement for streaming playback. Here are the main reasons:
Beyond silencing a warning, moving to VHS provides tangible benefits:
console.log(player.tech_.vhs.Vhs.version);
The warning is harmless in the short term, but you should update your code to avoid breakage when upgrading Video.js beyond version 7 or 8 (depending on your exact setup).