0.5.2 • Published 5 months ago

foxconn-yumeeting-sdk-js v0.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

ion-sdk-js

Frontend sdk for the Ion backend.

Installation

npm install ion-sdk-js

Usage

import { Client, LocalStream, RemoteStream } from 'ion-sdk-js';
import { IonSFUJSONRPCSignal } from 'ion-sdk-js/lib/signal/json-rpc-impl';
const signal = new IonSFUJSONRPCSignal("wss://ion-sfu:7000/ws");
const client = new Client(signal);
signal.onopen = () => client.join("test session", "test uid")

// Setup handlers
client.ontrack = (track: MediaStreamTrack, stream: RemoteStream) => {
    // mute a remote stream
    stream.mute()
    // unmute a remote stream
    stream.unmute()

    if (track.kind === "video") {
         // prefer a layer
         stream.preferLayer("low" | "medium" | "high")
    }
});

// Get a local stream
const local = await LocalStream.getUserMedia({
    audio: true,
    video: true,
    simulcast: true, // enable simulcast
});

// Publish stream
client.publish(local);

// mute local straem
local.mute()

// unmute local stream
local.unmute()

// create a datachannel
const dc = client.createDataChannel("data")
dc.onopen = () => dc.send("hello world")

// Close client connection
client.close();
0.5.2

5 months ago

0.5.1

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.5.0

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.7

1 year ago

0.3.2

1 year ago

0.3.3

1 year ago

0.3.0

2 years ago

0.2.7

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.6

2 years ago

0.1.9

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago