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

RMKSA resolves to undefined in some cases #3

Closed
joeyparrish opened this issue Nov 20, 2019 · 8 comments · Fixed by #7
Closed

RMKSA resolves to undefined in some cases #3

joeyparrish opened this issue Nov 20, 2019 · 8 comments · Fixed by #7
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly

Comments

@joeyparrish
Copy link
Member

There is a bug in the minified bundle (but not in the source) where requestMediaKeySystemAccess sometimes resolves to undefined.

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Nov 20, 2019
@joeyparrish joeyparrish self-assigned this Nov 20, 2019
joeyparrish referenced this issue in joeyparrish/eme-encryption-scheme-polyfill Nov 20, 2019
This helped expose several issues which will be fixed in follow-up
commits.  This also provides a platform for testing future
MediaCapabilities support in the polyfill.

Issue #1
Issue #2
Issue #3
Issue #4
joeyparrish referenced this issue in joeyparrish/eme-encryption-scheme-polyfill Nov 20, 2019
Babel was turning the "continue" statements in the for-of loop into
"return" statements.  If this were inside an anonymous function, this
would make sense, but it was not.  This would cause certain inputs to
cause a return of undefined in the compiled bundle.

This restructures the source to use if/else if/else instead of
continue in the loop.

Closes #3
joeyparrish added a commit that referenced this issue Nov 21, 2019
* Add demo and manual testing page

This helped expose several issues which will be fixed in follow-up
commits.  This also provides a platform for testing future
MediaCapabilities support in the polyfill.

Issue #1
Issue #2
Issue #3
Issue #4
joeyparrish added a commit that referenced this issue Nov 21, 2019
Babel was turning the "continue" statements in the for-of loop into
"return" statements.  If this were inside an anonymous function, this
would make sense, but it was not.  This would cause certain inputs to
cause a return of undefined in the compiled bundle.

This restructures the source to use if/else if/else instead of
continue in the loop.

Closes #3
@siarheipashkevich
Copy link

siarheipashkevich commented May 4, 2021

Hi @joeyparrish.
Could you please assist how to resolve the problem which you described above. I'm trying to launch dash+playready stream on the webos 3.0 TV, and installing all polyfills calling shaka.polyfill.installAll(); but when I try to launch, I'm getting an error 6001, but I dive deep and found that the main reason is EME polyfill which throw the next error:

"TypeError: undefined is not a function
    at eval [as program_] (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:23897:48)
    at $jscomp.generator.Engine_.nextStep_ (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:377:24)
    at $jscomp.generator.Engine_.next_ (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:342:19)
    at next (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:394:18)
    at eval (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:427:13)
    at new Promise (webpack:///./~/babel-polyfill/~/core-js/modules/es6.promise.js?:177:7)
    at Object.$jscomp.asyncExecutePromiseGenerator (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:420:14)
    at Object.$jscomp.asyncExecutePromiseGeneratorProgram (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:434:22)
    at Navigator.EmeEncryptionSchemePolyfill.probeRMKSA_ [as requestMediaKeySystemAccess] (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:23896:22)
    at eval [as program_] (webpack:///./~/shaka-player/dist/shaka-player.compiled.debug.js?:7636:38)"

I'm using the latest version of the shaka-player which are used the latest version of the EME polyfill.

Can you please help me how to avoid this error?

@joeyparrish
Copy link
Member Author

Your issue sounds like it is likely distinct from this issue, which we already resolved. In your issue, "undefined is not a function" means we are trying to call a function that does not exist. In this issue, though, a return value from an async function was missing. Although the word "undefined" is involved in both, they are very different symptoms and likely very different issues.

Please file a new issue with the backtrace above. Please also state what version of this polyfill (or of Shaka Player) you are using. It would also help if you could provide the exact debug bundle of Shaka Player that goes along with that backtrace, so that we could analyze and find out what specific method is missing.

We do not have a WebOS device of our own, so the only chance we have to resolve this for you is with the above information. Thanks!

@siarheipashkevich
Copy link

siarheipashkevich commented May 4, 2021

@joeyparrish I found the main reason of this issue is console.assert in the code for this polyfill. What do you think about this?

shaka-player: 3.1.0
eme: 2.0.3

userAgent where I run app: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.0 Safari/537.36"

Do you need any additional information?

@joeyparrish
Copy link
Member Author

Are you saying that WebOS 3 doesn't have console.assert?

@siarheipashkevich
Copy link

I think it is. Because if I comment all console.assert or add simply stub like console.assert = function () {} in my code at the beginning of my code then this error disappears.

@joeyparrish
Copy link
Member Author

Then I would advise you either:

  1. Use a production build of Shaka Player (.compiled.js) instead of a debug build, because the production build will remove all assertions automatically
  2. Polyfill console.assert in your application before loading the debug build of Shaka Player

According to caniuse.com, console.assert is supported all the way back to IE 8, which was released in 2009. So we are not going to bother patching platforms that are missing console.assert at this time. (Also, Shaka Player does not yet officially support WebOS.)

@siarheipashkevich
Copy link

Thank you, I will try your both solutions tomorrow and inform you about result.

Could you please tell where I can see that the Shaka Player does not support webOS?

@joeyparrish
Copy link
Member Author

https://github.com/google/shaka-player/#platform-and-browser-support-matrix

Specifically, this callout below the table:

@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Sep 28, 2021
@shaka-project shaka-project locked and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants