android - TypeError:null 不是对象(评估 'OT.setNativeEvents')
问题描述
我正在使用 opentok-react-native 向我的应用程序添加视频通话功能,代码在虚拟 android 设备中运行良好,但是当我尝试在我的物理设备上运行应用程序时,我收到此错误 TypeError: null is not an object(评估'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>
);
}
}
解决方案
推荐阅读
- sql - 如何将进入者存储到事件中以便稍后在 Spring JPA 中访问它们
- node.js - Twilio 耳语不起作用 - 被呼叫者在接听电话后立即与呼叫者建立连接
- informatica-powercenter - 是否可以限制 informatica 中列的值
- point-cloud-library - 如何从粗糙点云制作直线网格
- python - 如何根据日期列条件返回数据框
- c++ - UB是否将第一个联合成员重新解释为活动联合成员的类型?
- parsing - 如何存储解析器创建的抽象语法树?
- excel - 正确的/更短的代码来选择从最后一行到使用范围结束的范围,VBA?
- c# - 在 SSIS 中构建自定义组件
- python - 如何使 tkinter 窗口停留在窗口堆栈的底部