-2
user.rtcPeer = kurentoUtils.WebRtcPeerRecvonly(options, function(err) {
    if (err) {
      return console.log(err)
    }
    
    this.generateOffer(onOffer)
  })

output error:

Uncaught (in promise) TypeError: this.generateOffer is not a function

I want to generate offer

  • What is `this` in this context? I imagine `this` is not what you think it is. What is `generateOffer` a method of? – Andy Aug 20 '23 at 16:00
  • 2
    See [How to access the correct `this` inside a callback](/q/20279484/4642212) and [How does the "this" keyword work, and when should it be used?](/q/3127429/4642212). – Sebastian Simon Aug 20 '23 at 16:06
  • 1
    i followed the instructions on example in the kurento utils documentation [link](https://doc-kurento.readthedocs.io/en/latest/features/kurento_utils_js.html#examples). This should have a generateOffer method as described [here](https://doc-kurento.readthedocs.io/en/latest/features/kurento_utils_js.html#generateoffer). – zulfahmidev Aug 21 '23 at 02:21

0 Answers0