Skip to content

Commit

Permalink
Merge pull request #25 from THEOplayer/feature/8.0
Browse files Browse the repository at this point in the history
Feature/8.0
  • Loading branch information
tvanlaerhoven authored Sep 11, 2024
2 parents 1003d47 + 06b47d4 commit d1cbd4c
Show file tree
Hide file tree
Showing 14 changed files with 2,532 additions and 2,275 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged --allow-empty
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added support for THEOplayer 8.0.

## [1.6.0] - 2024-05-23

### Changed
Expand Down
4,714 changes: 2,480 additions & 2,234 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 21 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@
],
"scripts": {
"typescript": "tsc --noEmit",
"lint": "eslint \"**/*.{ts,tsx}\"",
"prepare": "bob build"
"prettier": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
"prettier:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:fix": "npm run lint -- --fix",
"prepare": "husky"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
"prettier --write"
]
},
"keywords": [
"react-native",
Expand All @@ -49,25 +57,26 @@
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@react-native-community/eslint-config": "^3.2.0",
"@types/react": "^18.2.75",
"@types/react-native": "^0.73.0",
"del-cli": "^5.1.0",
"@react-native/eslint-config": "^0.75.2",
"@types/react": "^18.3.5",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"pod-install": "^0.1.39",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"react": "^18.2.0",
"react-native": "^0.73.6",
"react-native": "^0.74.5",
"react-native-builder-bob": "^0.23.2",
"react-native-theoplayer": "^7.0.0",
"typescript": "^5.4.5"
"react-native-theoplayer": "^8.0.0",
"typescript": "^5.6.2"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-theoplayer": "^5.0.0 || ^6.0.0 || ^7.0.0"
"react-native-theoplayer": "^5 || ^6 || ^7 || ^8"
},
"eslintIgnore": [
"node_modules/",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {}
export {};
7 changes: 1 addition & 6 deletions src/anvato/AnvatoDrmFairplayContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import type {
CertificateRequest,
ContentProtectionIntegration,
LicenseRequest,
MaybeAsync,
} from 'react-native-theoplayer';
import type { CertificateRequest, ContentProtectionIntegration, LicenseRequest, MaybeAsync } from 'react-native-theoplayer';
import {
fromBase64StringToUint8Array,
fromObjectToUint8Array,
Expand Down
6 changes: 1 addition & 5 deletions src/anvato/AnvatoDrmWidevineContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import type {
ContentProtectionIntegration,
LicenseRequest,
MaybeAsync,
} from 'react-native-theoplayer';
import type { ContentProtectionIntegration, LicenseRequest, MaybeAsync } from 'react-native-theoplayer';
import {
fromBase64StringToUint8Array,
fromObjectToUint8Array,
Expand Down
1 change: 0 additions & 1 deletion src/castlabs/CastLabsDrmConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ export interface CastLabsDrmConfiguration extends DRMConfiguration {

integrationParameters: CastLabsIntegrationParameters;
}

16 changes: 11 additions & 5 deletions src/castlabs/CastLabsFairplayContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import type { CertificateRequest, ContentProtectionIntegration, LicenseRequest, LicenseResponse, MaybeAsync } from 'react-native-theoplayer';
import type { CastLabsDrmConfiguration } from './CastLabsDrmConfiguration';
import { fromObjectToBase64String, fromUint8ArrayToBase64String, fromStringToUint8Array, fromUint8ArrayToString, fromBase64StringToUint8Array } from 'react-native-theoplayer';
import {
fromObjectToBase64String,
fromUint8ArrayToBase64String,
fromStringToUint8Array,
fromUint8ArrayToString,
fromBase64StringToUint8Array,
} from 'react-native-theoplayer';

export class CastLabsFairplayContentProtectionIntegration implements ContentProtectionIntegration {
static readonly DEFAULT_CERTIFICATE_URL = 'https://lic.drmtoday.com/license-server-fairplay/cert/';
Expand All @@ -15,14 +21,14 @@ export class CastLabsFairplayContentProtectionIntegration implements ContentProt
const customDataObject = {
userId: this.contentProtectionConfiguration.integrationParameters.userId,
sessionId: this.contentProtectionConfiguration.integrationParameters.sessionId,
merchant: this.contentProtectionConfiguration.integrationParameters.merchant
merchant: this.contentProtectionConfiguration.integrationParameters.merchant,
};
this.customData = fromObjectToBase64String(customDataObject);
}

onCertificateRequest(request: CertificateRequest): MaybeAsync<Partial<CertificateRequest> | BufferSource> {
request.url = this.contentProtectionConfiguration.fairplay?.certificateURL ??
CastLabsFairplayContentProtectionIntegration.DEFAULT_CERTIFICATE_URL;
request.url =
this.contentProtectionConfiguration.fairplay?.certificateURL ?? CastLabsFairplayContentProtectionIntegration.DEFAULT_CERTIFICATE_URL;
request.headers = {
...request.headers,
};
Expand Down Expand Up @@ -53,7 +59,7 @@ export class CastLabsFairplayContentProtectionIntegration implements ContentProt
}

extractFairplayContentId(skdUrl: string): string {
this.contentId = skdUrl
this.contentId = skdUrl;
return this.contentId;
}
}
1 change: 0 additions & 1 deletion src/castlabs/CastLabsIntegrationParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ export interface CastLabsIntegrationParameters {
*
*/
userId?: string;

}
6 changes: 3 additions & 3 deletions src/castlabs/CastLabsPlayReadyContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export class CastLabsPlayReadyContentProtectionIntegration implements ContentPro
const customDataObject = {
userId: this.contentProtectionConfiguration.integrationParameters.userId,
sessionId: this.contentProtectionConfiguration.integrationParameters.sessionId,
merchant: this.contentProtectionConfiguration.integrationParameters.merchant
merchant: this.contentProtectionConfiguration.integrationParameters.merchant,
};
this.customData = fromObjectToBase64String(customDataObject);
}

onLicenseRequest(request: LicenseRequest): MaybeAsync<Partial<LicenseRequest> | BufferSource> {
request.url = this.contentProtectionConfiguration.playready?.licenseAcquisitionURL ??
CastLabsPlayReadyContentProtectionIntegration.DEFAULT_LICENSE_URL;
request.url =
this.contentProtectionConfiguration.playready?.licenseAcquisitionURL ?? CastLabsPlayReadyContentProtectionIntegration.DEFAULT_LICENSE_URL;
request.headers = {
...request.headers,
'x-dt-custom-data': this.customData!,
Expand Down
6 changes: 4 additions & 2 deletions src/castlabs/CastLabsWidevineContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export class CastLabsWidevineContentProtectionIntegration implements ContentProt
const customDataObject = {
userId: this.contentProtectionConfiguration.integrationParameters.userId,
sessionId: this.contentProtectionConfiguration.integrationParameters.sessionId,
merchant: this.contentProtectionConfiguration.integrationParameters.merchant
merchant: this.contentProtectionConfiguration.integrationParameters.merchant,
};
this.customData = fromObjectToBase64String(customDataObject);
}

onLicenseRequest(request: LicenseRequest): MaybeAsync<Partial<LicenseRequest> | BufferSource> {
request.url = (this.contentProtectionConfiguration.widevine?.licenseAcquisitionURL ?? CastLabsWidevineContentProtectionIntegration.DEFAULT_LICENSE_URL).replace("?specConform=true","");
request.url = (
this.contentProtectionConfiguration.widevine?.licenseAcquisitionURL ?? CastLabsWidevineContentProtectionIntegration.DEFAULT_LICENSE_URL
).replace('?specConform=true', '');
request.headers = {
...request.headers,
'x-dt-custom-data': this.customData!,
Expand Down
4 changes: 2 additions & 2 deletions src/pallycon/PallyConFairplayContentProtectionIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ContentProtectionIntegration, LicenseRequest, LicenseResponse, MaybeAsync } from 'react-native-theoplayer';
import type { PallyConDrmConfiguration } from './PallyConConfiguration';
import { fromBase64StringToUint8Array, fromStringToUint8Array, fromUint8ArrayToBase64String, fromUint8ArrayToString } from "react-native-theoplayer";
import { fromBase64StringToUint8Array, fromStringToUint8Array, fromUint8ArrayToBase64String, fromUint8ArrayToString } from 'react-native-theoplayer';

export class PallyConFairplayContentProtectionIntegration implements ContentProtectionIntegration {
static readonly DEFAULT_LICENSE_URL = 'https://license-global.pallycon.com/ri/licenseManager.do';
Expand All @@ -19,7 +19,7 @@ export class PallyConFairplayContentProtectionIntegration implements ContentProt
request.url = this.contentProtectionConfiguration.fairplay?.licenseAcquisitionURL;
request.headers = {
...request.headers,
...this.contentProtectionConfiguration.fairplay?.headers
...this.contentProtectionConfiguration.fairplay?.headers,
};
if (!this.contentId) {
throw new Error('The FairPlay PallyCon content ID has not been correctly configured.');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { ContentProtectionIntegration, ContentProtectionIntegrationFactory } from 'react-native-theoplayer';
import type { VerimatrixCoreDrmConfiguration } from './VerimatrixCoreDrmConfiguration';
import {
VerimatrixCoreDrmFairplayContentProtectionIntegration
} from './VerimatrixCoreDrmFairplayContentProtectionIntegration';
import { VerimatrixCoreDrmFairplayContentProtectionIntegration } from './VerimatrixCoreDrmFairplayContentProtectionIntegration';

export class VerimatrixCoreDrmFairplayContentProtectionIntegrationFactory implements ContentProtectionIntegrationFactory {
build(configuration: VerimatrixCoreDrmConfiguration): ContentProtectionIntegration {
Expand Down

0 comments on commit d1cbd4c

Please sign in to comment.