I'm trying to get the name of the publisher to display on top of the video stream (on both the Publisher's and Subscriber's ends) using the OpenTok React Native package.
According to the documentation for the OTPublisher component, it should be just a matter of passing in the name
key as one of the properties.
I've tried adding name to the properties and passing that through to the OTPublisher component, but it won't show up on the Publisher or the Subscriber. Do I need to do something else?
Here is the sample code I'm working with:
class App extends Component {
constructor(props) {
super(props);
this.publisherProperties = {
publishAudio: false,
cameraPosition: 'front',
name: 'Test Name'
};
this.publisherEventHandlers = {
streamCreated: event => {
console.log('Publisher stream created!', event);
},
streamDestroyed: event => {
console.log('Publisher stream destroyed!', event);
}
};
}
render() {
return (
<OTSession apiKey="your-api-key" sessionId="your-session-id" token="your-session-token">
<OTPublisher
properties={this.publisherProperties}
eventHandlers={this.publisherEventHandlers}
style={{ height: 100, width: 100 }}
/>
</OTSession>
);
}
}