0.5.3 • Published 1 year ago

foxconn-yumeeting-sdk-js v0.5.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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();

发布到npm仓库步骤: 1.设置仓库地址为npm官方仓库地址(国内大部分都使用阿里淘宝镜像,如果没改publish会失败) npm config set registry https://registry.npmjs.org/ 2.检查是否登录npm账号,需要登录npm才能发布新版本 npm whoami 如果报错则需要登录 npm login Username: Password: Email: (this IS public) 376942103@qq.com Logged in as xxxxx on https://registry.npmjs.org/. 3.推送新版本命令 npm run prepare npm publish

0.5.3

1 year ago

0.5.2

2 years ago

0.5.1

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.5.0

2 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.7

3 years ago

0.3.2

3 years ago

0.3.3

3 years ago

0.3.0

3 years ago

0.2.7

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.6

4 years ago

0.1.9

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago