AgoraIO / rtc-web-archive

Other
22 stars 29 forks source link

Both onSuccess and onFailure don't work when stream.init execute #30

Open yukitaka13-1110 opened 3 years ago

yukitaka13-1110 commented 3 years ago

Hi! I implement webrtc service with agora. It worked in notebook pc but desktop pc(external camera). This is my code. stream.init is fired because console log, prev and next line, is fired. But onSuccess and onFailure aren't working.

private publish(): void {
    if (this.localStream == null) return;

    console.log('in');
    this.localStream.init(
      () => {
        console.log('init success'); // Not called
        this.rtc!.publish(this.localStream!, (e) => {
          throw Error(e);
        });
      },
      (err) => {
        console.log('init failed'); // Not called
        throw Error(err.msg);
      }
    );
    console.log('out');
  }

error

What should I do ?

Environment

agora-rtc-sdk: 3.1.0 Dell desktop pc External camera

plutoless commented 3 years ago

can you maybe try running this navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(() => console.log("success")).catch(e => console.error)

yukitaka13-1110 commented 3 years ago

@plutoless I got “success”.

yukitaka13-1110 commented 3 years ago

@plutoless Any update? I can use google meets in my desktop pc. So getUserMedia works correctly.

plutoless commented 3 years ago

@yukitaka13-1110 https://webdemo.agora.io/agora-web-showcase/examples/Agora-Web-Tutorial-1to1-Web/ can you try out this demo to see if it works for you or not?

EASYNETY commented 3 years ago

Is agora limited in some countries?

I have agora SDK implemented on my app, the livestreaming is working fine on any system, but it always throw "WebRTC not available" on IOS and the go live button will not even respond at all on android mobiles..... Has anyone encountered this? and what is the solution please?

alexsorokoletov commented 3 years ago

If I understand the error it says that WebRTC is not available in the browser you are using. I assume you are using web SDK on iOS and if so, iOS WebView might not have it (limitation on some iOS versions) and anything using it might not have it too (iOS Firefox, Chrome etc)

Alex

On Feb 24, 2021, at 04:16, EASYNETY notifications@github.com wrote:

 Is agora limited in some countries?

I have agora SDK implemented on my app, the livestreaming is working fine on any system, but it always throw "WebRTC not available" on IOS and the go live button will not even respond at all on android mobiles..... Has anyone encountered this? and what is the solution please?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.