Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a name for a published stream(communication.callProperties.name) - updating globally #89

Open
parsetty opened this issue Aug 24, 2020 · 5 comments
Labels

Comments

@parsetty
Copy link

parsetty commented Aug 24, 2020

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.

image
image

Thanks
Parsetty

@parsetty
Copy link
Author

Hi All,
Added below code in

opentok-acc-core.js file line number 9446

if(typeof stream.name !== "undefined"){
callProperties.name=stream.name;
}

@ggoldens ggoldens added the bug label Aug 25, 2020
@Aemiola
Copy link

Aemiola commented Jan 12, 2021

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.

@saalimkhan18
Copy link

Is there any update on this bug?

@saalimkhan18
Copy link

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);
          }
        });
      }
    });
  };

@VRadl
Copy link

VRadl commented Mar 10, 2023

What's the status on this issue? It doesn't look like the suggested solution has been merged in.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants