Videojs Warn Player.tech--.hls Is Deprecated. Use Player.tech--.vhs Instead May 2026
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet" />
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script src="https://unpkg.com/videojs-http-streaming/dist/videojs-http-streaming.min.js"></script>
<video id="player" class="video-js vjs-default-skin" controls></video>
<script>
const player = videojs('player',
techOrder: ['html5'],
html5:
vhs:
overrideNative: true,
withCredentials: false,
maxBufferLength: 30
);
player.src( src: 'https://example.com/stream.m3u8', type: 'application/x-mpegURL' );
</script>
Change those occurrences to:
player.tech_.vhs
// or
player.tech().vhs
The warning indicates you're using the deprecated player.tech_.hls property. In modern Video.js versions (especially those using http-streaming or videojs-contrib-vhs), the correct property is player.tech_.vhs. <link href="https://unpkg
Do not access player.tech_.vhs immediately after player initialization. The tech may still be loading. Use the loadeddata or techready event: Change those occurrences to:
player
player.ready(() =>
// Ensure the underlying tech is ready
if (player.tech_ && player.tech_.vhs)
setupVHSEvents(player.tech_.vhs);
else
player.on('techready', () =>
setupVHSEvents(player.tech_.vhs);
);
);
After changing tech_.hls to tech_.vhs: