react-native-theoplayer
Version:
A THEOplayer video component for react-native.
29 lines (28 loc) • 1.17 kB
JavaScript
;
import { NativeModules } from 'react-native';
import { createNativeInterstitial } from './NativeInterstitialAdapter';
const NativeTHEOAdsModule = NativeModules.THEORCTTHEOAdsModule;
export class THEOAdsNativeAdapter {
// @ts-ignore
constructor(_player) {
this._player = _player;
}
get currentInterstitials() {
return this.getCurrentInterstitials();
}
get scheduledInterstitials() {
return this.getScheduledInterstitials();
}
async getCurrentInterstitials() {
const interstitials = await NativeTHEOAdsModule.currentInterstitials(this._player.nativeHandle);
return interstitials.map(interstitial => createNativeInterstitial(this._player.nativeHandle, interstitial));
}
async getScheduledInterstitials() {
const interstitials = await NativeTHEOAdsModule.scheduledInterstitials(this._player.nativeHandle);
return interstitials.map(interstitial => createNativeInterstitial(this._player.nativeHandle, interstitial));
}
replaceAdTagParameters(adTagParameters) {
NativeTHEOAdsModule.replaceAdTagParameters(this._player.nativeHandle, adTagParameters);
}
}
//# sourceMappingURL=THEOAdsNativeAdapter.js.map