videojs / mux.js

Lightweight utilities for inspecting and manipulating video container formats.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting "Cannot read property '0' of undefined", null check in parseUserData?

stomata opened this issue · comments

Environment:
I have a website implmeneted in ReactJS.
We are trying to implement DRM protected assets playback using the latest version of VideoJS.
Versions:
VideoJS: 7.8.1 (also tried 7.7.5)
mux.js: 5.5.4(also tried 5.2.1)
videojs-contrib-eme: 3.7.0

We get this error when trying to play a widevine protected content with Google Chrome browser on a Macbook:
image

Note: because we use npm to install pacakages. We have to npm install mux.js separatedly.
videojs/video.js#6417

I did a codepen version of using the following scripts and the player works without any problem.

<script src="https://unpkg.com/video.js/dist/video.js"></script> <script src="https://cdn.jsdelivr.net/npm/videojs-contrib-eme/dist/videojs-contrib-eme.min.js"></script>

Note that we don't have this issue when playing hls streams (Chrome, Safari, Firefox) nor hld streams with Fairplay DRM protection (in Safari)

Sorry I can't share the exact codepen code as that will expose some sensitive materials of our company.
Wondering if there's any reason why isn't there a null check in parseUserData() function of mux.js/lib/tools/caption-packet-parser.js ?
Is there any logical reason for not null checking?

If I add the null check for sei.payload, then the player will work fine.

We believe this is fixed as part of mux.js@5.6.1 (#336).