OpenStack DocumentationTechnical Documentation

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

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

Before:

player.tech_.hls.currentLevel = 2; // Switch to third quality level

After:

player.tech_.vhs.currentLevel = 2;

Before (deprecated):

const currentLevel = player.tech_.hls.currentLevel;
console.log(`Current bitrate level: $currentLevel`);

After (recommended):

const currentLevel = player.tech_.vhs.currentLevel;
console.log(`Current bitrate level: $currentLevel`);
function mapLegacyHlsOptions(opts) 
  return 
    vhs: 
      overrideNative: opts.overrideNative ?? true,
      withCredentials: opts.withCredentials ?? false,
      maxBufferLength: opts.maxBufferLength ?? 30,
      xhrTimeout: opts.xhrTimeout ?? 45000
;
const legacy =  overrideNative: true, maxBufferLength: 60 ;
const player = videojs('player',  techOrder: ['html5'], html5: mapLegacyHlsOptions(legacy) );

Video.js projects using the deprecated tech identifier player.tech--.hls must migrate to player.tech--.vhs to ensure compatibility with upstream maintenance and feature updates. This paper documents the history leading to the deprecation, compares the architectures of the two techs, provides step-by-step migration guidance with code examples, evaluates performance and compatibility implications, discusses testing strategies and rollout plans, and outlines future-proofing recommendations. Results show that migration is straightforward for most integrations, offers improved HLS feature support, and reduces maintenance risk.

VHS inherits from EventTarget. You can listen to events such as:

Example:

player.tech_.vhs.addEventListener('levelswitch', (e) => 
  console.log('Switched to level:', e.level);
);

Video.js is a popular open‑source HTML5 video player framework. For HLS streaming, it relies on a tech — the underlying playback engine. Historically, Video.js used a tech named hls (provided by the videojs-contrib-hls package).

Around Video.js version 7 and later, the project migrated to a new, more robust HLS library called VHS (Video.js HLS Streaming). VHS stands for Video.js HTTP Streaming, and it supports both HLS and DASH.

To maintain backward compatibility, an alias was kept: when you wrote player.tech_.hls, it still pointed to the VHS tech for a while. Starting with certain Video.js versions (typically v7+ with updated contrib packages), using the old name triggers this deprecation warning. Before: player

The warning is telling you:

“You are using a legacy property name. It still works for now, but you should switch to the new property name — player.tech_.vhs — because the old one will be removed in a future release.”


Change those occurrences to:

player.tech_.vhs
// or
player.tech().vhs

4 Comments

  • videojs warn player.tech--.hls is deprecated. use player.tech--.vhs instead Tyler says:

    I’m working through your walk through and I am stuck at

    “virt-install –connect qemu:///system –arch=x86_64 -n ws2012 -r 2048 –vcpus=2 –disk path=/tmp/ws2012.qcow2,device=disk,bus=virtio,size=15 -c /mnt/Source/en_windows_server_2012_x64_dvd_915478.iso –vnc –noautoconsole –os-type windows –os-variant win7 –network=bridge:virbr0 –disk path=/mnt/Source/en_windows_server_2012_x64_dvd_915478.iso,device=cdrom,perms=ro -c /mnt/Source/virtio-win-0.1-81.iso”

    I get: ERROR Unknown argument ‘-connect’

    I cannot find any online support for this and I’ve been googling for hours now, I’m wondering if you had an idea how I can get past this step?

  • videojs warn player.tech--.hls is deprecated. use player.tech--.vhs instead Rohit says:

    Hello,it is possible to create image in .raw!???

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share