bitmovin-player-react-native
Version:
Official React Native bindings for Bitmovin's mobile Player SDKs.
30 lines • 1.07 kB
JavaScript
import { Platform } from 'react-native';
import SourceModule from '../modules/SourceModule';
/**
* Provides FairPlay-specific DRM runtime APIs for an active {@link Source}.
*
* Accessible via {@link Source.drm}.fairplay.
*
* @platform iOS, tvOS
*/
export class FairplayDrmApi {
sourceNativeId;
constructor(sourceNativeId) {
this.sourceNativeId = sourceNativeId;
}
/**
* Renews an expiring FairPlay license for the provided content key request.
* Has no effect if called on Android.
*
* @platform iOS, tvOS
* @param contentKeyRequest - The content key request from a {@link FairplayLicenseAcquiredEvent}.
*/
renewExpiringLicense = async (contentKeyRequest) => {
if (Platform.OS === 'android') {
console.warn(`[Source ${this.sourceNativeId}] renewExpiringLicense is not available on Android.`);
return;
}
return SourceModule.drmFairplayRenewExpiringLicense(this.sourceNativeId, contentKeyRequest.skdUri);
};
}
//# sourceMappingURL=fairplayDrmApi.js.map