While the original engine ( videojs-contrib-hls ) was built specifically for HLS, developers realized the same core logic could handle multiple formats.
Because VHS handles multiple formats, calling it .hls was technically inaccurate when the player was actually playing a DASH stream.
You may get undefined if you access player.tech_.vhs before the tech is ready. Always wrap in player.ready() or listen to 'loadedmetadata' .
Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET Access-Control-Allow-Headers: Range While the original engine ( videojs-contrib-hls ) was
<script src="https://vjs.zencdn.net/7.20.3/video.js"></script> <script src="https://cdn.jsdelivr.net/npm/videojs-contrib-hls@6.0.0/dist/videojs-contrib-hls.min.js"></script> <script> var player = videojs('my-video', techOrder: ['html5', 'hls'] ); player.src( src: 'https://example.com/stream.m3u8', type: 'application/x-mpegURL' ); </script>
Migration from videojs-player.tech--.hls to player.tech--.vhs: Motivation, Implementation, and Performance Implications
videojs.log.level('debug');
VIDEOJS: WARN: player.tech_.hls is deprecated. Use player.tech_.vhs instead.
var representations = player.tech_.vhs.representations(); representations[2].enabled(true);
Developers often access the HLS object to manually change video qualities or read the available bitrates. javascript Always wrap in player
player.tech_.hls.on('playlistchanged', function() console.log('The playlist changed!'); ); Use code with caution. javascript
;
Maya almost ignored it. Deprecated, not broken, she thought. It can wait until morning. var representations = player
// This uses the updated, unified engine syntax var currentPlaylist = player.tech().vhs.playlists.media(); Use code with caution. 2. Update Initialization Options