Skip to content

Commit

Permalink
more params for onGetLicense (spcBase64 and contentId)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Mariño committed Oct 7, 2019
1 parent c7a8a25 commit 8c40aaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class Video extends Component {
if (this.props.drm && this.props.drm.getLicense instanceof Function) {
const data = event.nativeEvent;
if (data && data.spc) {
const getLicenseOverride = this.props.drm.getLicense(data.spc, this.props);
const getLicenseOverride = this.props.drm.getLicense(data.spc, data.contentId, data.spcBase64, this.props);
const getLicensePromise = Promise.resolve(getLicenseOverride); // Handles both scenarios, getLicenseOverride being a promise and not.
getLicensePromise.then((result => {
if (result !== undefined) {
Expand Down
2 changes: 2 additions & 0 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,8 @@ - (BOOL)loadingRequestHandling:(AVAssetResourceLoadingRequest *)loadingRequest {
NSString *spcStr = [[NSString alloc] initWithData:spcData encoding:NSASCIIStringEncoding];
self->_requestingCertificate = YES;
self.onGetLicense(@{@"spc": spcStr,
@"contentId": contentId,
@"spcBase64": [[NSData alloc] initWithBase64EncodedData:certificateData options:NSDataBase64DecodingIgnoreUnknownCharacters],
@"target": self.reactTag});
} else if(licenseServer != nil) {
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
Expand Down

0 comments on commit 8c40aaf

Please sign in to comment.