Developers often access the HLS object to manually change video qualities or read the available bitrates. javascript
VHS replaced the old plugin entirely and comes bundled natively with Video.js (versions 7 and newer). Because the engine is completely new, the old hls object became a legacy wrapper. The underlying technology is now entirely driven by vhs .
VIDEOJS: WARN: player.tech_.hls is deprecated. use player.tech_.vhs instead
const player = videojs('my-player');
<!DOCTYPE html> <html> <head> <link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet" /> <script src="https://vjs.zencdn.net/7.20.3/video.js"></script> <!-- Old HLS plugin (now built into core but this line is redundant) --> <script src="https://cdn.jsdelivr.net/npm/videojs-contrib-hls@5.15.0/dist/videojs-contrib-hls.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'); // Deprecated usage – will show warning player.ready(function() console.log('HLS tech name:', player.techName_); if (player.tech_.hls) player.tech_.hls.on('loadedplaylist', function() console.log('Old playlist event'); );
Ensure you are using a modern, compatible version of Video.js and its streaming components.
player.tech_.vhs // or player.tech().vhs Developers often access the HLS object to manually
The double hyphen ( -- ) in the property name is a convention used by Video.js to namespace technology-specific properties. player.tech_.hls refers to the HLS technology instance, but the correct modern property is player.tech_.vhs .
Example:
Over time, videojs-contrib-hls became the de facto standard for HLS playback in Video.js, but it had limitations: it was maintained as a separate project, had its own configuration quirks, and sometimes lagged behind the core Video.js releases. The underlying technology is now entirely driven by vhs
Years ago, native browser support for HLS playback outside of Apple's Safari was virtually non-existent. To solve this, the Video.js team created a plugin called videojs-contrib-hls . This plugin exposed its internal engine on the player object under the namespace player.tech_.hls . Developers frequently used this namespace to listen to specific HLS events, manipulate segment playlists, or handle decryption keys. The Modern Era: Video.js HTTP Streaming (VHS)
var player = videojs('my-player', html5: hls: overrideNative: true ); Use code with caution. javascript
Look for any instance of player.tech_.hls (or just .tech_.hls if player is your variable). player
A common use case is manually switching between HLS renditions (qualities). Here's how to migrate:
To resolve this warning and future-proof your code, simply replace the deprecated property in your JavaScript: