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

How to get initData in Clearkey #123

Closed
fancofang opened this issue Sep 28, 2020 · 1 comment
Closed

How to get initData in Clearkey #123

fancofang opened this issue Sep 28, 2020 · 1 comment

Comments

@fancofang
Copy link

Hi,
I used the example you gave, it worked.
The origin example:

player.src({
        src: '/moose_encrypted.webm',
        type: 'video/webm',
        keySystems: {
          'org.w3.clearkey': {
            audioContentType: 'audio/webm; codecs="vorbis"',
            videoContentType: 'video/webm; codecs="vp8"',
            getLicense: function (emeOptions, keyMessage, callback) {
            ...

But when I try to change the src to cloud url, it doesn't work even it`s the same encrypted video. I can't get the InitData in 'encrypted' event.

 player.src({
        src: 'https://m3u8video.s3.eu-west-2.amazonaws.com/testeme/moose_encrypted.webm',
        type: 'video/webm',
        keySystems: {
          'org.w3.clearkey': {
            audioContentType: 'audio/webm; codecs="vorbis"',
            videoContentType: 'video/webm; codecs="vp8"',
            getLicense: function (emeOptions, keyMessage, callback) {
            ...

Is there anything I get wrong? The Cloud url is public, please feel free to try it. Thank you.

@fancofang
Copy link
Author

I fix it already.

There is a rule about initData

The initData attribute will be null if the media data is not CORS-same-origin or is mixed content. Applications may retrieve the Initialization Data from an alternate source.

So, I set crossorigin="same-origin" in

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

No branches or pull requests

1 participant