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: use in-spec EME for versions of Safari which support it #87

Closed

Conversation

squarebracket
Copy link
Contributor

haven't updated the docs yet.

@squarebracket
Copy link
Contributor Author

Note that, as I said in #86, you must add {initDataTypes: ['sinf'], videoCapabilities: [{contentType: 'video/mp4'}]} to your keySystems.

src/eme.js Show resolved Hide resolved
@misteroneill misteroneill changed the title fix: support in-spec EME for Safaris which support it fix: use in-spec EME for versions of Safari which support it May 8, 2019
@squarebracket
Copy link
Contributor Author

Ok, I think this one is ready. Added some tests and stuff.

Manually tested on:

  • Chrome
  • Firefox
  • IE11
  • Edge
  • Safari 11.1.2 on macOS 10.11.6 (only prefixed support)
  • Safari 12.1 macOS 10.13.6 (only prefixed support)
  • Safari 12.1 macOS 10.14.4 (prefixed + spec support)
  • Safari 12.1 on iOS 12.2 (prefixed + spec support)

@squarebracket
Copy link
Contributor Author

squarebracket commented May 21, 2019

Closes #79.

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I'll do some testing with our internal libraries, but I don't anticipate any issues based on review.

@squarebracket
Copy link
Contributor Author

squarebracket commented May 21, 2019

I found a problem when testing #80 (which, incidentally, does not seem to this problem). Right here, I'm actually overwriting the object when I should simply assign to the object.

@squarebracket
Copy link
Contributor Author

One other thing. When using newer Safari with the default fairplay getLicense, you get a warning that using an ArrayBuffer with XMLHttpRequest.send() is deprecated. If right here

body: keyMessage,

We instead do

body: new Uint8Array(keyMessage),

This warning does not appear. Is that something you think we could do?

Alternatively, we could use the defaultGetLicense for eme instead of the default one for fairplay, but that gets a bit complicated because here you'd have to know whether or not you're using the default getLicense.

@misteroneill
Copy link
Member

I think we'd be safe casting it to Uint8Array. I think there's an expectation that the default* methods may change to better suit the changing reality of browsers.

@alenzalex
Copy link

#105

@alenzalex
Copy link

alenzalex commented Jun 5, 2020

Safari Version : 13.1

When I play DRM content in safari, I get error as
KeySession error: code 6, systemCode 4294924646
with error code as : (CODE:5 MEDIA_ERR_ENCRYPTED)

Then, it displays error as
The media playback was aborted due to a corruption problem or because the media used features your browser did not support
with error code : (CODE:3 MEDIA_ERR_DECODE)

@AwokeKnowing
Copy link

@squarebracket can you clarify what you mean by you must add {initDataTypes: ['sinf'], videoCapabilities: [{contentType: 'video/mp4'}]} to your keySystems.

#118

my initData looks like this when decoded to string, and then the concat data id and cert method throws because of 'not aligned' which I assume is because init data is wrapped?

"{
  \"sinf\" : [
    \"AAAADGZybWFtcDRhAAAAFHNjaG0AAAAAY2JjcwABAAAAAAA5c2NoaQAAADF0ZW5jAQAAAAAAAQBVfi4NGlUpptLaOvCQxUuIEK6Awu7gJUgka4p2J91djjU=\"
  ]
}"

@squarebracket
Copy link
Contributor Author

@AwokeKnowing These are unrelated. This PR added a hotfix to use the old prefixed EME version because we couldn't get the in-spec EME working. That was because of the missing {initDataTypes: ['sinf'], videoCapabilities: [{contentType: 'video/mp4'}]} that I outlined above, which should probably (for this PR) be added to the default object that's created when using safari with in-spec EME, so that problems don't happen.

@squarebracket
Copy link
Contributor Author

Nevermind, it looks like I did add it to the default object in this PR. It's been a while since I wrote this 😅

@brandonocasey brandonocasey changed the base branch from master to main September 30, 2021 19:14
@gkatsev gkatsev closed this in #142 Oct 15, 2021
gkatsev added a commit that referenced this pull request Oct 15, 2021
Closes #87 

Co-authored-by: Gary Katsevman <git@gkatsev.com>
Co-authored-by: Chuck Wilson <chuck.wilson+github@gmail.com>
@gkatsev
Copy link
Member

gkatsev commented Oct 15, 2021

Thanks for getting this started @squarebracket! It finally made it in via #142, sorry it's taken so long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants