Open parsetty opened 4 years ago
if(typeof stream.name !== "undefined"){
callProperties.name=stream.name;
}
Is there a resolution due for this issue ? We have run into it on our project and would love to know if a fix is pending.
Is there any update on this bug?
added the following code in this.subscribe function of the opentok-acc-core.js
if(typeof stream.name !== "undefined"){ callProperties.name=stream.name; }
UPDATED CODE WILL LOOK LIKE THIS
this.subscribe = function (stream) {
var subscriberProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var networkTest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var analytics = _this.analytics,
state = _this.state,
streamContainers = _this.streamContainers,
session = _this.session,
triggerEvent = _this.triggerEvent,
callProperties = _this.callProperties,
screenProperties = _this.screenProperties;
return new Promise(function (resolve, reject) {
if(typeof stream.name !== "undefined"){
callProperties.name=stream.name;
}
var connectionData = void 0;
analytics.log(logAction.subscribe, logVariation.attempt);
var streamMap = state.getStreamMap();
var streamId = stream.streamId;
// No videoType indicates SIP https://tokbox.com/developer/guides/sip/
var type = pathOr('sip', 'videoType', stream);
if (streamMap[streamId] && !networkTest) {
// Are we already subscribing to the stream?
var _state$all = state.all(),
subscribers = _state$all.subscribers;
resolve(subscribers[type][streamMap[streamId]]);
} else {
try {
connectionData = JSON.parse(path(['connection', 'data'], stream) || null);
} catch (e) {
connectionData = path(['connection', 'data'], stream);
}
var container = dom.element(streamContainers('subscriber', type, connectionData, stream));
var options = Object.assign({}, type === 'camera' || type === 'sip' ? callProperties : screenProperties, subscriberProperties);
var subscriber = session.subscribe(stream, container, options, function (error) {
if (error) {
analytics.log(logAction.subscribe, logVariation.fail);
reject(error);
} else {
state.addSubscriber(subscriber);
triggerEvent('subscribeTo' + properCase(type), Object.assign({}, { subscriber: subscriber }, state.all()));
type === 'screen' && triggerEvent('startViewingSharedScreen', subscriber); // Legacy event
analytics.log(logAction.subscribe, logVariation.success);
resolve(subscriber);
}
});
}
});
};
What's the status on this issue? It doesn't look like the suggested solution has been merged in.
Thank you
Adding a name for a published stream and using the communication.callProperties.name while init app, it is updating to all publishers stream. Please find the screenshot below, please help on this.
Thanks Parsetty