UNPKG

@sendbird/calls-react-native

Version:

Sendbird Calls SDK for React Native: Empower React Native apps with seamless audio, video, and group calling. Build interactive communication easily.

54 lines 2.44 kB
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable @typescript-eslint/no-explicit-any */ import React, { createRef } from 'react'; import { findNodeHandle, requireNativeComponent } from 'react-native'; import { LINKING_ERROR } from '../utils/constants'; const MODULE_NAME = 'RNSBGroupCallVideoView'; const NativeViewModule = requireNativeComponent(MODULE_NAME); if (!NativeViewModule) throw new Error(LINKING_ERROR); export default class GroupCallVideoView extends React.PureComponent { constructor(...args) { super(...args); _defineProperty(this, "ref", /*#__PURE__*/createRef()); } get handle() { const nodeHandle = findNodeHandle(this.ref.current); if (nodeHandle == null || nodeHandle === -1) { throw new Error('Cannot found VideoView'); } return nodeHandle; } get validProps() { const { android_zOrderMediaOverlay = false, mirror = false, resizeMode = 'contain', participant, roomId, style, ...rest } = this.props; return { zOrderMediaOverlay: android_zOrderMediaOverlay, mirror, resizeMode, participantId: participant === null || participant === void 0 ? void 0 : participant.participantId, roomId, state: participant === null || participant === void 0 ? void 0 : participant.state, style, ...rest }; } get videoViewId() { return this.handle; } render() { return /*#__PURE__*/React.createElement(NativeViewModule, _extends({ ref: this.ref }, this.validProps)); } } //# sourceMappingURL=GroupCallVideoView.js.map