Videojs Warn Player.tech--.hls Is Deprecated. Use Player.tech--.vhs Instead ((better)) -
Video.js HTTP Streaming (VHS) replaced the separate videojs-contrib-hls and DASH plugins.
To resolve this, you need to update how you access the streaming technology object and how you configure your player options. 1. Update Programmatic Access
If you switch to .vhs and it returns undefined , check the following: videojs-http-streaming (VHS) - GitHub Update Programmatic Access If you switch to
var player = videojs('my-video', { html5: { hls: { overrideNative: true } } }); Use code with caution. javascript
var player = videojs('my-video'); player.ready(function() { // This triggers the warning var hls = player.tech().hls; console.log(hls.playlists.master); }); Use code with caution. javascript var player = videojs('my-video', { html5: { vhs:
Because VHS handles multiple formats, calling it .hls was technically inaccurate when the player was actually playing a DASH stream.
var player = videojs('my-video', { html5: { vhs: { overrideNative: true } } }); Use code with caution. Why the Change Happened Potential "Undefined" Issues
Since Video.js 7, the player uses a unified engine called (Video.js HTTP Streaming) to handle both HLS and DASH streams. This change ensures a more consistent API regardless of the streaming protocol being used. How to Fix the Deprecation Warning
var player = videojs('my-video'); player.ready(function() { // Use .vhs instead var vhs = player.tech().vhs; if (vhs) { console.log(vhs.playlists.master); } }); Use code with caution. 2. Update Configuration Options
VHS is bundled by default in Video.js 7 and 8 , offering improved cross-browser compatibility and features like low-latency HLS . Potential "Undefined" Issues