Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Uint8Array believed to be an ArrayBuffer when blacklisting based on key-id #889

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Jan 28, 2021

Since at least the v3.21.1 release, we had an issue that appeared when blacklisting Representation based on the keyID (e.g. when a keystatuseschange event indicates us that we are "output-restricted and when fallbacking is enabled through the related keySystems options).

This issue prevented from fallbacking, it just threw an Error message along the lines of:
TypeError: DataView: expected ArrayBuffer, got Uint8Array

The root cause was linked to typing issues (we will consequently cleverly redirect all wrong-doing to typescript, not our fault at all here :p) where an Uint8Array was considered to be a valid ArrayBuffer.

At some point, a new DataView(whatIThoughtToBeAnArrayBufferWhichIsInRealityAUint8Array) was done, leading to the aforementioned error.

The fix here is to now consider the type to be an Uint8Array and to do Uint8Array things instead (i.e. no DataView anymore).

…on key-id

Since at least the v3.21.1 release, we had an issue that appeared when
blacklisting Representation based on the keyID (e.g. when a
`keystatuseschange` event indicates us that we are "output-restricted
and when fallbacking is enabled through the related `keySystems`
options).

This issue prevented from fallbacking, it just threw an Error message
along the lines of:
`TypeError: DataView: expected ArrayBuffer, got Uint8Array`

The root cause was linked to typing issues (we consequently cleverly
redirect all wrong-doing to typescript, not our fault at all here :p:
microsoft/TypeScript#42534) where an
Uint8Array was considered to be a valid ArrayBuffer.

At some point, a `new
DataView(whatIThoughtToBeAnArrayBufferWhichIsInRealityAUint8Array)` was
done, leading to the aforementioned error.

The fix here is to now consider the type to be an Uint8Array and to do
Uint8Array things instead (i.e. no DataView anymore).
@peaBerberian peaBerberian added bug This is an RxPlayer issue (unexpected result when comparing to the API) DRM Relative to DRM (EncryptedMediaExtensions) Ready for Review The Pull Request is in its final form and ready to be reviewed by someone labels Jan 28, 2021
@peaBerberian peaBerberian mentioned this pull request Jan 28, 2021
20 tasks
@peaBerberian peaBerberian added this to the 3.23.0 milestone Jan 28, 2021
@grenault73 grenault73 merged commit 49cec46 into master Jan 28, 2021
@peaBerberian peaBerberian deleted the fix/blacklist-uint8array branch February 11, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is an RxPlayer issue (unexpected result when comparing to the API) DRM Relative to DRM (EncryptedMediaExtensions) Ready for Review The Pull Request is in its final form and ready to be reviewed by someone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants