http-streaming
http-streaming copied to clipboard
Live + AES javascript error - Uncaught TypeError: Cannot read properties of undefined (reading 'slice')
Description
I'm playing an HLS stream encoded with AES symetric key (Azure Media services live with AES enabled) When the videojs player try to switch to another bandwidth (by user interaction or network bandwidth evolution) there is a javascript error here : https://github.com/videojs/http-streaming/blob/1e2f7a42aecdd26f127374888b4c8664ca6d245f/src/media-segment-request.js#L579 Uncaught TypeError: Cannot read properties of undefined (reading 'slice') after that, the player is frozen and is not usable anymore
adding a console.log show key.bytes is undefined adding and early return here to prevent error remove the error, but the player stay unuseable
Sorry, I can't let a test case opened because a live streaming cost money.
The videojs version is the latest one : 7.21.0 The bug is always reproduced in the described scenario
On VOD (video on demand, not live scenario) the bug is NOT reproduced
Sources
https://github.com/videojs/http-streaming/blob/1e2f7a42aecdd26f127374888b4c8664ca6d245f/src/media-segment-request.js#L579 key.bytes is undefined
Steps to reproduce
Create a videojs player playing a multi-stream HLS AES secured stream, and change played bandwidth
Results
Expected
Playing well, without error
Error output
VideoPlayer.js?9e5f:345 error TypeError: Cannot read properties of undefined (reading 'slice') at decrypt (video.es.js?f0e2:42462:1) at eval (video.es.js?f0e2:42654:1) at eval (video.es.js?f0e2:42150:1) at callbackWrapper (video.es.js?f0e2:31135:1) at Object.eval [as callback] (video.es.js?f0e2:31160:1) at cbOnce (index.js?3603:104:1) at XMLHttpRequest.loadFunc (index.js?3603:178:1)
Additional Information
Please include any additional information necessary here. Including the following:
videojs-http-streaming version
what version of videojs-http-streaming does this occur with? videojs-http-streaming 2.15.0 according to video.js sources
videojs version
videojs 7.21.0
Browsers
what browsers are affected? please include browser and version for each chrome Version 107.0.5304.107 (Build officiel) (64 bits)
Platforms
what platforms are affected? please include operating system and version or device and version for each Window 10
Other Plugins
are any other videojs plugins being used on the page? If so, please list them with version below. yes
Other JavaScript
are you using any other javascript libraries or frameworks on the page? if so please list them below. no