Legal Help Available. Call (612) 888-9567 or email [email protected].

Member Login (Coming Soon) 

Videojs | Warn Player.tech--.hls Is Deprecated. Use Player.tech--.vhs Instead

);

The warning is — your HLS playback still works. You can safely ignore it temporarily, but you should update your code before upgrading Video.js to v8 or later, where the deprecated property may be removed entirely.

To resolve the warning, replace any instance where you access the "tech" via Old Code (Deprecated): javascript hls = player.tech().hls; playlists = player.tech().hls.playlists.media(); Use code with caution. Copied to clipboard New Code (Recommended): javascript vhs = player.tech().vhs; playlists = player.tech().vhs.playlists.media(); Use code with caution. Copied to clipboard Initialization Options

Replace any direct references to player.tech_.hls with player.tech_.vhs : ); The warning is — your HLS playback still works

Unlike the old HLS tech, VHS supports both HLS and DASH streams.

If you are running into specific issues during your refactor, let me know: What are you currently running?

// OLD HLS events player.tech_.hls.on('loadedmetadata', () => {}); player.tech_.hls.on('levelchanged', (e, data) => {}); Copied to clipboard New Code (Recommended): javascript vhs

Some events have changed names or moved:

Starting with Video.js version 7.0.0, VHS became the recommended way to handle HLS streams. However, for backward compatibility, the old hls tech was kept as a deprecated alias.

If you use captions or audio tracks, ensure they still work: // OLD HLS events player

To resolve the warning "videojs warn player.tech--.hls is deprecated. use player.tech--.vhs instead," you need to update your code to use the Video.js HTTP Streaming (VHS)

If you are listening for HLS-specific lifecycle events via the player tech, you must update the namespaces there as well. javascript

Scroll to Top