TypeError:null不是对象正在评估'OT.setNativeEvents'

问题描述

我正在使用opentok-react-native将视频通话功能添加到我的应用程序中,代码在虚拟android设备中运行正常,但是当我尝试在物理设备上运行该应用程序时出现此错误 TypeError:null不是对象(正在评估'OT.setNativeEvents') 有人可以帮帮我吗 。 我的代码

 import React,{Component} from 'react';
import {View} from 'react-native';
import {OT,OTPublisher,OTSession,OTSubscriber} from "opentok-react-native";

    export default class VideoCall extends Component {
    constructor(props) {
   super(props);

    this.publisherProperties = {
      publishAudio: false,cameraPosition: 'front'
    };

  this.publisherEventHandlers = {
    streamCreated: event => {
      console.log('Publisher stream created!',event);
    },streamDestroyed: event => {
      console.log('Publisher stream destroyed!',event);
    }
    };
   }

  render() {
    return (
         <OTSession apiKey="my api" sessionId="session id " token="token">
      <OTPublisher
        properties={this.publisherProperties}
        eventHandlers={this.publisherEventHandlers}
        style={{ height: 100,width: 100 }}
      />
    </OTSession>
  );
  }
 }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)