[2.8.0] TypeError: Cannot read property 'getStreamInfo' of undefined
Created by: fvalleeHbbTV
I've a tricky case of a (local) dynamic stream where periods are added dynamically by the server when the manifest is updated and I get the following exception :
(unknown)Uncaught` TypeError: Cannot read property 'getStreamInfo' of undefined at compareCodecs at Object.isCompatibleWithStream at onStreamCanLoadNext
The problem occurs because the manifest duration is infinity but the manifest contains only 2 periods. (In DashAdapter.js convertPeriodToStreamInfo set isLast to false for the 2 periods - I guess this is correct).
Then in StreamController.js onStreamCanLoadNext()
var isLast = getActiveStreamInfo().isLast;
if (mediaSource && !isLast) {
(function () {
var newStream = getNextStream();
newStream is undefined (because the next period is not yet available in the manifest). I guess check if newStream is valid before calling
activeStream.isCompatibleWithStream(newStream);
is enough to fix the issue but I may be missing something. Thanks!