Socket
Socket
Sign inDemoInstall

opentok-react-native

Package Overview
Dependencies
4
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.10.3 to 0.11.0

1

docs/OTSubscriber.md

@@ -10,2 +10,3 @@ ### OTSubscriber Component

| eventHandlers | Object<Function> | No | Event handlers passed into the native subscriber instance
| subscribeToSelf | Boolean | No | If true, subscribe to his own stream (default: false)

@@ -12,0 +13,0 @@ ## Properties

4

package.json
{
"name": "opentok-react-native",
"version": "0.10.3",
"version": "0.11.0",
"description": "React Native components for OpenTok iOS and Android SDKs",

@@ -28,3 +28,3 @@ "main": "src/index.js",

"dependencies": {
"axios": "^0.18.0",
"axios": "^0.19.0",
"prop-types": "^15.6.0",

@@ -31,0 +31,0 @@ "underscore": "^1.8.3",

@@ -100,2 +100,3 @@ import React, { Component, Children, cloneElement } from 'react';

sessionId: this.props.sessionId,
sessionInfo: this.state.sessionInfo
},

@@ -102,0 +103,0 @@ ) : child),

@@ -15,2 +15,3 @@ import React, { Component } from 'react';

streams: [],
subscribeToSelf: props.subscribeToSelf || false
};

@@ -50,14 +51,19 @@ this.componentEvents = {

streamCreatedHandler = (stream) => {
const { streamProperties, properties } = this.props;
const { subscribeToSelf } = this.state;
const { streamProperties, properties, sessionInfo } = this.props;
const subscriberProperties = isNull(streamProperties[stream.streamId]) ?
sanitizeProperties(properties) : sanitizeProperties(streamProperties[stream.streamId]);
OT.subscribeToStream(stream.streamId, subscriberProperties, (error) => {
if (error) {
this.otrnEventHandler(error);
} else {
this.setState({
streams: [...this.state.streams, stream.streamId],
});
}
});
// Subscribe to streams. If subscribeToSelf is true, subscribe also to his own stream
const sessionInfoConnectionId = sessionInfo && sessionInfo.connection ? sessionInfo.connection.connectionId : null;
if (subscribeToSelf || (sessionInfoConnectionId !== stream.connectionId)){
OT.subscribeToStream(stream.streamId, subscriberProperties, (error) => {
if (error) {
this.otrnEventHandler(error);
} else {
this.setState({
streams: [...this.state.streams, stream.streamId],
});
}
});
}
}

@@ -96,2 +102,4 @@ streamDestroyedHandler = (stream) => {

containerStyle: PropTypes.object, // eslint-disable-line react/forbid-prop-types
sessionInfo: PropTypes.object, // eslint-disable-line react/forbid-prop-types
subscribeToSelf: PropTypes.bool
};

@@ -104,2 +112,4 @@

containerStyle: {},
sessionInfo: {},
subscribeToSelf: false
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc