player.tech().hls is deprecated. Use player.tech().vhs instead #2
grep -r "tech_.hls" --include="*.js" --include="*.vue" --include="*.ts"
Ensure your conditional checks handle cases where tech_.vhs might be undefined (e.g., if a user is on a browser playing a fallback format).
Now go ahead and implement these changes – your users (and your future self) will thank you for a more robust, efficient, and modern video player. player
var player = videojs('my-player'); player.ready(function() // Access 'vhs' instead of 'hls' var vhs = player.tech().vhs; if (vhs) vhs.xhr.beforeRequest = function(options) // Your logic using vhs ; ); Use code with caution. Addressing player.tech( IWillNotUseThisInPlugins: true )
npm uninstall videojs-contrib-hls
to:
Resolving this warning requires auditing your JavaScript files for any instances where you reference player.tech_.hls or player.tech_['hls'] and replacing them with the updated vhs syntax.
If you maintain a Video.js plugin that accesses tech_.hls , update it and bump the major version (or at least a minor version with a deprecation warning). Notify users that they should upgrade.
const currentLevel = player.tech_.vhs.currentLevel; console.log(`Current bitrate level: $currentLevel`); var player = videojs('my-player'); player
VHS (Video.js HTTP Streaming) was created to be a single, format-agnostic engine capable of playing both . Since the engine is no longer exclusive to HLS, the Video.js team renamed the internal properties and options to reflect this broader support.
// Old/Deprecated var player = videojs('my-video', html5: hls: overrideNative: true ); // New/Correct var player = videojs('my-video', html5: vhs: overrideNative: true ); Use code with caution. Copied to clipboard 2. Update Runtime Access
New features, performance optimizations, and security patches are only applied to the vhs codebase, not the deprecated hls bridge. How to Fix the Warning: Common Code Patterns Notify users that they should upgrade
Clear your browser cache, restart your dev server, and check your package.json for any lingering references to videojs-contrib-hls . Run npm ls videojs-contrib-hls to see if it’s still a dependency of another package.