opentok-react icon indicating copy to clipboard operation
opentok-react copied to clipboard

OpenTok:Publisher:error onPublishingTimeout

Open andreynav opened this issue 4 years ago • 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!

andreynav avatar Jan 27 '21 19:01 andreynav

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

kamenivskyi avatar Aug 09 '21 09:08 kamenivskyi

@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 avatar Aug 12 '21 07:08 enricop89

@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?

kamenivskyi avatar Aug 12 '21 08:08 kamenivskyi

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 avatar Aug 12 '21 08:08 enricop89

@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

kamenivskyi avatar Aug 12 '21 09:08 kamenivskyi

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

enricop89 avatar Aug 12 '21 09:08 enricop89

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

e-vural avatar Sep 20 '22 14:09 e-vural

I have same problem with chromebook. image

ilyadesyatov avatar Oct 24 '22 18:10 ilyadesyatov