0

This could be the very basic question of javascript but i am not able to figure out to use the namespance named AudioBridge from the kandy.js file but i dont how should i import the audioBridge namesame in my own js and use it.

Here is the CDN link of kandy.js

Following is the screenshot of the kandy apis AudioBridge feature , how shall i able to use these apis defined in the kandy.js

enter image description here

Link to kandy documentation

2

1 Answer 1

1

In your html you will have you script tag like this:

    <script src="myJavascriptFile.js" type="module"></script>

The type is required and will allow you to use imports in your script.

Your Javascript file will then look like this:

    import { create } from '/whereEverIStore/kandy.js';

    const client = create({
      authentication: { ... },
      logs: { ... },
      // .... more
    });    

I hope this helps.

NOTE: the { create } syntax is destructuring and can be found here: MDN Destructuring

Sign up to request clarification or add additional context in comments.

13 Comments

i can use create , but how shall i use AudioBridge
shall i use this way <script src="Kandy.js" type="audioBridge"></script> ?
I suspect you need import { create, AudioBridge }
@Bibberty That link leads to a new codepen, not yours.
think kandy.audioBridge.create(), or in the code above client.audioBridge.create()
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.