Custom skin support added for ios. onReceiveAdEvent prop added to catch ad events on ios.

This commit is contained in:
sdkcy
2021-07-26 16:11:37 +03:00
parent 96c717d6df
commit 0f94a3d956
4 changed files with 206 additions and 114 deletions

View File

@@ -253,6 +253,13 @@ export default class Video extends Component {
}
}
}
_onReceiveAdEvent = (event) => {
if (this.props.onReceiveAdEvent) {
this.props.onReceiveAdEvent(event.nativeEvent);
}
};
getViewManagerConfig = viewManagerName => {
if (!NativeModules.UIManager.getViewManagerConfig) {
return NativeModules.UIManager[viewManagerName];
@@ -328,6 +335,7 @@ export default class Video extends Component {
onGetLicense: nativeProps.drm && nativeProps.drm.getLicense && this._onGetLicense,
onPictureInPictureStatusChanged: this._onPictureInPictureStatusChanged,
onRestoreUserInterfaceForPictureInPictureStop: this._onRestoreUserInterfaceForPictureInPictureStop,
onReceiveAdEvent: this._onReceiveAdEvent,
});
const posterStyle = {
@@ -499,6 +507,7 @@ Video.propTypes = {
onPictureInPictureStatusChanged: PropTypes.func,
needsToRestoreUserInterfaceForPictureInPictureStop: PropTypes.func,
onExternalPlaybackChange: PropTypes.func,
onReceiveAdEvents: PropTypes.func,
/* Required by react-native */
scaleX: PropTypes.number,