Videojs Warn Player.tech--.hls Is: Deprecated. Use Player.tech--.vhs Instead
To cleanly resolve the warning across your application, follow these quick steps:
if (vhs) vhs.on('loadedplaylist', () => console.log('Playlist loaded'); );
player.getTech().vhs.on('segmentloaderror', (e) => ... );
const player = videojs('my-video');
If you are passing options to the player during initialization, update the key from hls to vhs within the html5 object. javascript To cleanly resolve the warning across your application,
var representations = player.tech_.vhs.representations(); representations[2].enabled(true);
// CORRECT player.tech_.vhs.on('loadedplaylist', function() console.log('Playlist loaded via VHS engine'); ); Use code with caution. 3. Safe Cross-Version Implementation
let seekable = player.tech_.vhs.seekable(); player.tech_.vhs.on('mediaqualitychange', function() console.log('Quality changed'); );
If you do not see these strings in your own source code, the warning is likely coming from an external Video.js plugin. The code inside VHS does something like: Let's
That alias is what triggers the warning. The code inside VHS does something like:
Let's outline:
If you need help refactoring a specific configuration, please let me know: What you are currently running?
The legacy hls bridge acts as an extra layer of translation between old code semantics and the modern VHS engine. console.log(`Current bitrate level: $currentLevel`)
This warning is an important signal that your codebase is relying on legacy Video.js internals. While your video player might still be working perfectly fine for now, ignoring this deprecation warning risks breaking your video streams in future library updates.
const currentLevel = player.tech_.hls.currentLevel; console.log(`Current bitrate level: $currentLevel`);
Update associated quality selection or analytics plugins to their latest versions.