Closed karendolan closed 1 year ago
It would help to initialize the Video container with _validContentIds = [];
[EDIT] That didn't help it just pushes the issue to another error further down, still related to the race condition.
I don't think I would have ever detected this issue. Thank you!
The problem can be easily fixed by checking the state of the player, instead of checking the value of this.streamData
.
I will probably have to change something else, since the updateLayout()
function is also called at the end of the video loading()
function, but before the state changes. I think that it can fix it by adding some kind of private parameter to the setLayout()
function so that it does not check the state only in this case.
There is a delay between
this._streamData = streamData
andthis._validContentIds = getValidContentIds(this.player, streamData);
https://github.com/polimediaupv/paella-core/blob/main/src/js/core/VideoContainer.js#L378-L381So the protection in this check doesn't catch that _validContentIds is still undefined.
returns true, but
this._validContentIds
a few lines down is still undefined, and throws an uncaught exception whenthis._validContentIds.indexOf
is called on it. https://github.com/polimediaupv/paella-core/blob/main/src/js/core/VideoContainer.js#L378-L381