opentok/opentok-react

OpenTok:Publisher:error onPublishingTimeout

Opened this issue ยท 8 comments

Hi, today I'm faced with a row of errors when the client tries to connect the establishment:

OpenTok:Publisher:error OT.Publisher.onPublishingTimeout +0ms

OpenTok:GlobalExceptionHandler:error OT.exception :: title: Unable to Publish (1500) msg: ICEWorkflow
index.js:3535

OpenTok:Session:error 1500 +0ms Session.publish :: Could not publish in a reasonable amount of time

Reproduced for me on the Chrome v. 88.0.4324.96 (Official Build) (x86_64) / MacOS Mojave 10.14.5

On the Chrome Canary or FF not reproduced.
Also not reproduced on the Chrome v. 88.0.4324.96 (Official Build) (x86_64) / Windows 10

Any thoughts? Need help!

I have the same problem on Iphone Safari v.14. using this https://www.npmjs.com/package/@opentok/client package.

@kamenivskyi are you able to reproduce it consistently? It sounds like a network error to me. Can you try with a different network, please? You can also inspect the session using https://tokbox.com/developer/tools/inspector/

@enricop89 It is not an error related to network, for me it works in google chrome and firefox(android) but not safari or probably i missed something in code. I found the old code without the device selection and it works there well, but when in current code with device selects it does not work.
Could it be a problem that I run this code:

async detectDevices() {
      await OT.getUserMedia().then(async (stream) => {
          const devices = await this.getAvailableDevices();
          this.updateDevicesSelects(devices);

          stream.getTracks().forEach(track => track.stop());
      });
  },

after the token and publisher have initialized?

Yes, in iOS Safari you can't have two active getUserMedia at the same time. In your case, you have <OTPublisher> and the detectDevices function above. What's the goal of function anyway? For the device selection you can use navigator.mediaDevices.enumerateDevices()

@enricop89 well, thank you very much! :). I just tried to do similar to this example: https://opentok.github.io/opentok-web-samples/Publish-Devices/js/app.js and get devices like this:

 await OT.getDevices((err, devices) => {
      if (err) {
          console.log('error occurred in getAvailableDevices func: , ', err);
          reject(err);
      }
      const 
audioDevices = devices.filter((device) => device.kind === 'audioInput');
      const videoDevices = devices.filter((device) => device.kind === 'videoInput');

      if (videoDevices && audioDevices) {
          resolve({ video: videoDevices, audio: audioDevices });
      }
  });

inside the OT.getUserMedia() promise.
I will try with navigator.mediaDevices.enumerateDevices

OT.getDevices is a wrapper of navigator.mediaDevices.enumerateDevices

I have same problem with Chrome 105.0.5195.136. Any real solution?

I have same problem with chromebook.
image