react-native-theoplayer
Version:
A THEOplayer video component for react-native.
23 lines (22 loc) • 938 B
JavaScript
;
import { TheoAdsEventType } from 'react-native-theoplayer';
import { DefaultTheoAdsErrorEvent, DefaultTheoAdsEvent } from '../PlayerEvents';
import { createNativeInterstitial } from '../../theoads/NativeInterstitialAdapter';
export function fromNativeTheoAdsEvent(node, event) {
const {
type,
nativeEvent
} = event;
switch (type) {
case TheoAdsEventType.INTERSTITIAL_ERROR:
return new DefaultTheoAdsErrorEvent(TheoAdsEventType.INTERSTITIAL_ERROR, createNativeInterstitial(node, nativeEvent.interstitial), nativeEvent.message);
case TheoAdsEventType.ADD_INTERSTITIAL:
case TheoAdsEventType.INTERSTITIAL_BEGIN:
case TheoAdsEventType.INTERSTITIAL_END:
case TheoAdsEventType.INTERSTITIAL_UPDATE:
return new DefaultTheoAdsEvent(type, createNativeInterstitial(node, nativeEvent.interstitial));
default:
return undefined;
}
}
//# sourceMappingURL=NativeTheoAdsEvent.js.map