Giter Club home page Giter Club logo

Comments (4)

disoul avatar disoul commented on July 21, 2024 2

Thanks for your feedback! 👍

Your suggestions are very nice and helpful, I think we can add some of them to our team's roadmap.

Bundle size

There are a lot of babel-polyfill codes in the current SDK bundle. However, these codes are redundant in most scenarios. We build SDK with the polyfill codes because some customers want to import(not use!) our SDK in some very old browsers. (maybe they just want to import our SDK in <script> tag and call checkSystemRequirements to display an unsupported warning.)

Adding an ESM bundle is a good solution. In the ESM bundle we can remove these unuseful codes and support tree shaking.

Performance

We are planning to merge these analytics requests or use WebSocket to report analytics data.

CORP & COEP

I think it is necessary for Agora service to support CORP & COEP, SharedArrayBuffer is very useful in some WASM applications. But this is not our team's work, I will try to push our backend service team.

Audio Context

This sounds good, I will add this API in the future version.

But please be attention that If developers pass their own AudioContext to SDK, they have to write many iOS/Safari AudioContext workarounds by themself. Such as no sound in iOS silent mode, no sound in iOS 12 randomly.

from agorawebsdk-ng.

Jarred-Sumner avatar Jarred-Sumner commented on July 21, 2024 1

Thanks for the detailed response! Also, your English is really good.

But please be attention that If developers pass their own AudioContext to SDK, they have to write many iOS/Safari AudioContext workarounds by themself. Such as no sound in iOS silent mode, no sound in iOS 12 randomly.

Yeah, manually managing AudioContext is not fun (especially in Safari).

Chrome has a little-known API that tells you if creating an AudioContext will work before you actually create it:

if (
  navigator?.userActivation?.isActive ||
  navigator?.userActivation?.hasBeenActive
) {
  this.getAudioContext();
}

I don't see documentation for navigator.userActivation other than old blog posts though and it's Chrome only. But it might help reduce cases where an AudioContext is created prematurely in Chrome

My understanding is that our service now supports the CORS protocol, so there is no need to add the Cross-Origin-Resource-Policy header, right?

You're right – I misread the document, I thought it required both CORS & CORP rather than either CORS or CORP. I was also missing the Cross-Origin-Opener-Policy header.

Edit: It works in Firefox correctly, but once these headers are added, it no longer works in Chrome – at least, on localhost.
image

This is with the following headers on the page:
image

I'm working around this issue by proxying these domains and editing the code to request relative to / rather than https:// (e.g. /webrtc2-ap-web-1.agora.io/url):

const PROXY_DOMAINS = [
  "webrtc2-ap-web-1.agora.io",
  "webrtc2-ap-web-2.agoraio.cn",
  "webrtc2-ap-web-3.agora.io",
  "webrtc2-ap-web-4.agoraio.cn",
  "ap-proxy-1.agora.io",
  "ap-proxy-2.agora.io",
  "cds-ap-web-1.agora.io",
  "cds-ap-web-2.agoraio.cn",
  "cds-ap-web-3.agora.io",
  "cds-ap-web-4.agoraio.cn",
  "sua-ap-web-1.agora.io",
  "sua-ap-web-2.agoraio.cn",
  "sua-ap-web-3.agora.io",
  "sua-ap-web-4.agoraio.cn",
  "uap-ap-web-1.agora.io",
  "uap-ap-web-2.agoraio.cn",
  "uap-ap-web-3.agora.io",
  "uap-ap-web-4.agoraio.cn",
];

BTW, have you seen RNNoise? Its better than native noise cancellation and fast enough to run in real-time on browsers. I integrated it into the game to cover up laptop fan noise in voice chat. I'd be a little wary of using it in browsers that don't support Audio Worklet or any older browsers, but it might be a cool feature to add sometime later since it would (theoretically) improve audio call quality & make the volume level stuff better at distinguishing between speech and ambient noise.


On an unrelated note, do you know how to get pushing a livestream to CDN to work? I'm trying to make it push a MediaStreamTrack from a Canvas element to an RTMP url and I get invalid_appid. I filed a support ticket about this: CUS-7128 and was able to reproduce the issue in both Agora Web SDK and Agora Web SDK NG.

from agorawebsdk-ng.

disoul avatar disoul commented on July 21, 2024

I have tested our demo page in cross-origin isolated mode on Firefox 79, it works fine and I can access the SharedArrayBuffer API.

image

Then I read the spec and find this line:

"require-corp"
When this value is used, fetching cross-origin resources requires the server's explicit permission through the CORS protocol or the Cross-Origin-Resource-Policy header.

My understanding is that our service now supports the CORS protocol, so there is no need to add the Cross-Origin-Resource-Policy header, right?

from agorawebsdk-ng.

disoul avatar disoul commented on July 21, 2024

It seems that Chrome and Firefox have different CORE strategies. But I think it is still necessary for Agora Service to add this header(there are no side effects in this header I thought).


😃 RNNoise and other software 3A algorithms are in our plan. Chrome's AEC module will not process the audio from WebAudio(https://bugs.chromium.org/p/chromium/issues/detail?id=687574). So we need a way to implement audio 3A processing through JavaScript or WASM.


Have you enabled the RTMP Converter service for your APPID in your Agora Console?
image

from agorawebsdk-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.