Skip to content

Conversation

@yurtaev
Copy link

@yurtaev yurtaev commented Oct 7, 2019

I don't know why but spcString is empty (on js side) if app running not in debug mode.

I think different behavior (unicode strings?) between JavaScriptCore & V8/Chrome (debug mode) is causing this.

Any ideas?

Demo: https://github.com/yurtaev/react-native-video/blob/example%2FDRM/storybook/stories/DRMExample/index.ios.js#L20

}
if (spcData != nil) {
if(self.onGetLicense) {
NSString *spcStr = [[NSString alloc] initWithData:spcData encoding:NSASCIIStringEncoding];
Copy link
Author

Choose a reason for hiding this comment

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

Maybe related:

but spcStr is not empty in xcode debugger.

@CHaNGeTe
Copy link

CHaNGeTe commented Oct 7, 2019

Sorry I didn't saw your PRs and pushed the changes already thinking it was a request, can you try last version of the branch?

@yurtaev
Copy link
Author

yurtaev commented Oct 7, 2019

Sure. Let me update the demo app.

@sanjeevghimire
Copy link

sanjeevghimire commented Feb 20, 2020

@yurtaev
I am also facing the same issue:

what is the resolution?

@sanjeevghimire
Copy link

My getlicense function is:

getLicense: (spcData, contentId, spcBase64) => {
              console.log("spc", spcData);
              console.log("spcBase64", spcBase64);
              return fetch("https://fp-keyos.licensekeyserver.com/getkey/", {
                method: "POST",
                headers: {
                  "Content-Type": "application/x-www-form-urlencoded",
                  customdata: xml
                },
                body: `spc=${spcBase64}&assetId=${contentId}`
              }).then(r => r.text());
            }
          }

and on RCTVideo.m

self.onGetLicense(@{@"spc": spcStr,
                                      @"contentId": contentId,
                                      @"spcBase64": [spcData base64EncodedStringWithOptions:0],
                                      @"target": self.reactTag});

@sanjeevghimire
Copy link

@yurtaev Any help is appreciated?

@yurtaev
Copy link
Author

yurtaev commented Feb 21, 2020

@sanjeevghimire check diff Video.js + try to use getLicense: async ({ spcBase64, contentId }) => {

alexejh pushed a commit to simpleTechs/react-native-video that referenced this pull request Jul 29, 2022
Add support for L1 to L3 Widevine fallback if playback fails initially.
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.

3 participants