Javascript 更新OpenTok react native的PublishAudio和publishVideo
使用: 问题链接: 我创建了一个如下所示的会话Javascript 更新OpenTok react native的PublishAudio和publishVideo,javascript,react-native,opentok,Javascript,React Native,Opentok,使用: 问题链接: 我创建了一个如下所示的会话 <OTSession style={{ width: '100%', height: '100%'}} apiKey={this.state.apiKey} sessionId={this.state.sessionId} token={this.sta
<OTSession
style={{ width: '100%', height: '100%'}}
apiKey={this.state.apiKey}
sessionId={this.state.sessionId}
token={this.state.token}
eventHandlers={this.sessionEventHandlers}
>
但这对Publisher没有影响
需要在运行时停止并开始发布音频
publisherPropertiesOne = {
publishAudio: true,
publishVideo: true,
cameraPosition: 'front'
};
<OTPublisher
style={{ width: '100%', height: '100%' }}
eventHandlers={this.publisherEventHandlers}
properties={this.publisherPropertiesOne}
/>
setVolumeOnOff() {
const currentStatus = this.state.publisherProperties.publishAudio
var currentProperty = this.state.publisherProperties
currentProperty.publishAudio = !currentStatus
this.publisherPropertiesOne.publishAudio = !currentStatus
console.log('being updated for audio: ', this.publisherPropertiesOne)
this.setState({
publisherProperties: currentProperty
})
}