Coder Social home page Coder Social logo

ion-sdk-js's People

Contributors

adwpc avatar avxit avatar billylindeman avatar brendanmoore avatar cloudwebrtc avatar daniel-d-truong avatar dreamerns avatar greko6 avatar hkirat avatar jbrady42 avatar kcking avatar kevinmcconnell avatar kevmo314 avatar leewardbound avatar orlandoco avatar renovate-bot avatar renovate[bot] avatar tarrencev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ion-sdk-js's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

IonSFUJSONRPCSignal加入自定义数据接收

通过signal中的call或者notify可以发送自定义的数据。看源码websocket被保护了,无法使用原生事件。
那该如何接收后台广播的自定义数据。从而实现一些定制化功能

Audio MediaStreamTrack.enabled always true

Your environment.

  • Version: 1.7.2
  • Browser: chrome
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

I want to create button to toggle audio off on,
i need current status audio to show icon related to current status

isMuted(kind) {
    try {
        if (kind === 'audio') {
            const tracks = this.localStream.getAudioTracks()
            tracks.forEach(track => {
                console.log('track: ', track)
            })
            // return this.localStream.getAudioTracks()[0].enabled
            return tracks[0].enabled
        }
        if (kind === 'video') {
            return this.localStream.getVideoTracks()[0].enabled
        }
        throw new Error('track kind is required')
    } catch (error) {
        console.error(error);
    }
},
console.log('audio muted', this.isMuted('audio'))
this.localStream.mute('audio')
console.log('audio muted', this.isMuted('audio'))

client.publish(this.localStream)

this.localStream.unmute('audio')
console.log('audio muted', this.isMuted('audio'))

this.localStream.mute('audio')
console.log('audio muted', this.isMuted('audio'))

What did you expect?

MediaStreamTrack.enabled is false after localStream.mute('audio')
MediaStreamTrack.enabled is true after localStream.unmute('audio')

What happened?

MediaStreamTrack.enabled always true

Leave room

Your environment.

  • Version:1.5.8
  • Browser:Chromium

What did you do?

I tried to leave from a room using client.leave() to join other.

What happened?

When i tried to use client.join(roomId), it throwed "rtc transport already exists for this connection".

Having error

Your environment.

  • Version: latest
  • Browser: edge
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context
    image

What did you do?

Join into session

What did you expect?

We can join the session and see other people video

What happened?

Error

Documentation

Sorry I am quite new to this. Is there any documentation for this sdk to know the available functions and their parameters?

新的版本bug

新版问题:

1、在1.0.18中,使用火狐浏览器会报 (WebRTC: ICE failed, add a TURN server and see about:webrtc for more details)

2、在采用ion-sdk-js 1.0.18 后台采用 ion-sfu 1.0.35 的情况下,会出现以下情况:
1)火狐浏览器打开2个页面,一个负责发送流,一个负责接收流。接收流的页面无法接收到 track 和 stream。
2)谷歌浏览器打开2个页面,一个负责发送流,一个负责接收流。接收流的页面可以收到一组track和stream,track标记是audio。
3)发送端采用谷歌浏览器,接收端采用火狐浏览器。火狐浏览器无法接收到track和stream。
4)发送端采用狐火浏览器,接收端采用谷歌浏览器。谷歌页面可以接收到2组track和stram。track标记分别audio和video。

  以上4中场景,只有4可以正常播放视频。
  场景2中,谷歌浏览器通过LocalStream.getUserMedia拿到的流可以直接播放,
  但是把流 publish 后, 通过ontrack 再次拿到之后 流 无法播放。

Join with RoomId and UserId

Hi,

I'm trying to use the latest ion-sdk-js. How to join into roomId with userId, because, I only see that join function is only one parameter.

image

Thank you.

Best Regards,
Edwin

Firefox Support

Firefox Support

This is the Browser Market Share Worldwide:
https://gs.statcounter.com/browser-market-share#monthly-201903-202003-bar
Chrome has > 60% share worldwide

Ion support chrome well, but on firefox, we need to do many work(low priority):

  1. use _payloadModify(in Client.js) to modify the sdp when publish or subscribe

on chrome, we use 111 for opus, 96 for vp8 and 102 for h264 ,as a reference
we should do this for firefox

  1. test audio and video between firefox to firefox , firefox to chrome

  2. other js bug on firefox

If anyone can help, that would be awsome!

版本1.1.2 ,LocalStream.getUserMedia 函数无法使用

在版本1.1.2中,调用获得用户流函数 LocalStream.getUserMedia时会报不是一个函数:
Uncaught (in promise) TypeError: ion_sdk_js__WEBPACK_IMPORTED_MODULE_2__.LocalStream.getUserMedia is not a function at _callee$ (HelloWorld.vue?140d:49) at tryCatch (runtime.js?96cf:63) at Generator.invoke [as _invoke] (runtime.js?96cf:293) at Generator.eval [as next] (runtime.js?96cf:118) at asyncGeneratorStep (asyncToGenerator.js?1da1:3) at _next (asyncToGenerator.js?1da1:25) at eval (asyncToGenerator.js?1da1:32) at new Promise (<anonymous>) at eval (asyncToGenerator.js?1da1:21) at VueComponent.local (HelloWorld.vue?140d:49)

(bug)stream.mute

Your environment.

  • Client: 1.6.2
  • Server: ion-sfu 1.9.7
  • Are you using a TURN server? coturn

What did you do?

I am trying to mute only audio MediaStream by stream.mute("audio")

What did you expect?

The sound should stop playing

What happened?

Nothing happens. I continue to hear a sound.

Safari MediaStream Error

Your environment.

  • Version: 0.4.1
  • Browser: Safari

What did you do?

A "ReferenceError: Can't find variable MediaStream stream.js:26" error occurs after creating the final file and publishing it on the site in the Safari browser.

How do I subscribe/unsubcribe to specific streams with v1.0.7 ?

When I was using v0.4.1, I can subscribe to specific streams by const remote = client.subscribe(mid); (example use case is: there 50 peers in a room, and at any moment, I only need to subscribe to 5 of the peers who are talking and ignore the other 45).
How can I achieve the same functionality with v1.0.7 ? I see that subscribe, unsubscribe methods are removed from Client class.
Thank you very much. Really appreciate what you all doing with ION!

p2p data channels

Add support for establishing p2p data channels between participants.

Useful for things like file sharing

Does it work with React Native

Hello Everyone, after few days research and headache with JutsiMeet, I got to know pion-ion but I'm wondering if it's work with React Native or Not.

If it's not supported at the moment probably I will try to contribute in this SDK and make it capable with React naive by using react native webRTC.

Couldn't Import IonSFUGRPCWebSignal

Hello, I'm testing out this SDK on a React application, with the intent of connecting to my SFU using gRPC but am having issues.

What did you do?

  1. Ran npm install ion-sdk-js
  2. Ran the following code
    image
  3. Got an error Module not found: Can't resolve './_proto/library/sfu_pb' in '/Users/dantruong/projects/video-test/node_modules/ion-sdk-js/lib/signal'

What did you expect?

I expected the import to work.

What happened?

I checked the node_modules and saw that the following was the ion-sdk-js directory structure:
image

For some reason, there is no ion-sdk-js/lib/signal/_proto/library/sfu_pb even though the program expects it. So my guess is that npm didn't install the library properly?

Share screen audio issue

Your environment.

  • Version: 1.6.2
  • Browser: MS Edge, Chrome
  • Other Information - audio start to echo or like broken after share screen -> mute -> unmute

What did you do?

Share screen using getDisplayMedia with audio. The steps are share screen -> mute -> unmute

What did you expect?

The audio should not echoing or broken

What happened?

The audio start echoing or broken, and after a while it will be annoying audio like cracking or something.

ReferenceError: MediaStream is not defined

Your environment.

  • Version: 1.7.2
  • Runtime: NodeJS v14.16.1
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

Running the code in readme with ts-node

What did you expect?

The code running

What happened?

Got an error of MediaStream is not defined

Switch camera to desktop capture

Hi Anyone,

Can someone give some example how to switch camera to desktop capture? or maybe camera to desktop capture + camera.

Thank you.

Best Regards,
Edwin

Modify answer SDP error

Your environment.

  • Version: Latest from git
  • Browser: latest chrome
  • Other Information - image

What did you do?

Modify answer SDP

           sfuObj.answer = (answer) => {
            LOG && console.log("****** answer: ", answer);
            let sdp = this.setApplicationSpecificBandwidth(
              answer.sdp,
              bandwidth,
              this.currentScreenShare
            );
            sdp = this.setVideoBitrates(sdp, {
              min: bandwidth.video,
              max: bandwidth.video,
            });
            sdp = this.setOpusAttributes(sdp, {
              stereo: 0, // to disable stereo (to force mono audio)
              "sprop-stereo": 1,
              maxaveragebitrate: 500 * 1024 * 8, // 500 kbits
              maxplaybackrate: 500 * 1024 * 8, // 500 kbits
              cbr: 0, // disable cbr
              useinbandfec: 1, // use inband fec
              usedtx: 1, // use dtx
              maxptime: 3,
            });
            answer.sdp = sdp;
          };

What did you expect?

Bandwidth usage decreased

What happened?

Error : "error creating answer: TypeError: provided value is not a valid enum value of type SDPType: '0' is not a valid enum value of type SDPType"

(feat) onconnectionstatechange

export onconnectionstatechange so that:
user can catch and respond to Network interruptions or a change from wifi to another connection

Latest version of ion-sdk-js package does not emit events for stream-add rtc messages

Your environment.

  • Version: >= 1.5.3
  • Browser: include version
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

I setup an ion cluster, ran a javascript app using the ion-sdk-js package, and had two peers join the call to see if they can subscribe to each others' stream.

What did you expect?

I expect there to be a way to hook into stream-add rtc messages. They include stream IDs which I believe are what should be used when subscribing to a peers' stream.

At the moment, the library only provides access to new peers through the ontrack method which is emitting different stream ids than the stream-add rtc messages.

  • Why are the stream ids different when emitted from ontrack and stream-add rtc messages?
  • Which one should the client actually subscribe to?
  • Can we please add a callback for a the stream-add rtc message? (I can submit a PR for this)

What happened?

The stream-add rtc event is ignored and the only accessible callback is the ontrack callback which may be emitting stream ids which are not valid (within the context of the ion sfu).

最新版本找不到index文件。

升级到1.0.21版本后,通过项目测试会报:
This relative module was not found:

  • ./signal in ./node_modules/ion-sdk-js/lib/index.js

await join() issue

Your environment.

  • Version: master
  • Browser: chrome/edge

What did you do?

This is how my code looks like the outline at least P.S using react

signalRef.current = new IonSFUJSONRPCSignal(host);
clientRef.current = new Client(signalRef.current, webrtcConfig);

await clientRef.current.join(meshidRef.current);

signalRef.current.onopen = async () => {
    ....
})

clientRef.current.ontrack = async (track, stream) => {
   ....
})

await publishStream()

Now the main bug comes here

await clientRef.current.join(meshidRef.current);

if i add an await here then if there is another peer on the call, i don't recieve his onTrack event. only if new peers join i recieve the onTrack not for people already on the call.

What did you expect?

i expect await should only wait for me to join on the call. if i use await it should mean i won't get ontrack of users already on the call

What happened?

版本1.4.6

版本1.4.6 bug:

  1. getUserMedia 函数已经移到LocalStream中,文档没有修改
  2. 接收到的流通过new LocalStream (this.stream, streamOptions) 无法播放出来

How to create recvonly client?

Hi,

Is there anyway to create the client with recvonly option? I simply just want to receive remote stream without publishing.

Thanks.

Add statistics

Summary

Users should be able to get webrtc stats from interconnection. This can either be implemented by ION specific stats API, or simply be able to grab RTCPeerConnection from transport and do pc.getStats(). The latter approach is much easier to implement but could have unpredicted side-effects if user keeps the reference. Having more structured API built on top of PC would be a more elegant solution, but requires more time to build.

Motivation

Every call SDK has some type of stats API that can provide more insights about the call to the user.

Describe alternatives you've considered

Transport could provide access to RTCPeerConnection, in which case user can implement its own stats gathering logic.

integrating an external auth service - peer id/uid

I'm sorry for not using a template, but it isn't a bug report nor a feature request.

I'm trying to integrate my own auth service (uses nestjs along with typeorm , postgres and jwt) along with the sfu, using ion-sdk-js with react on the frontend.
First of all, I managed to create a working conference (currently audio only for I have no webcam) call easily using ion-sfu's docker image and the frontend library, it was an awesome experience so that's first!
I messed around with the frontend library, I can see a way to send a user id to the sfu and it works great (I can see the peer id being printed in the signaling process logs).
the problem is I don't see how I'm supposed to consume this value (nor do I know whether I should).
I read the FAQ of ion-sfu's git repo and it was mentioned that the apps should use the streamId and map that to a user value of a sort.

the streamId doesn't seem to contain a hint of peer info or uid so I'd appreciate it if anyone could point me to an article about how to do such a mapping
I stil lwonder why do we pass a uid to the Join function if we can't use it along with the incoming tracks or onspeaker, or maybe there's a best practice that I missed?

Thanks in advance

Edit: I can see how I could make use of a data channel to pass user data along, is this the best way though?

Vue JS support

Does this have a VueJS support? Because I can't seem to make it work. If so, do you have any documentations I can follow? Thanks!

safari does not support extending native classes

Your environment.

  • Version: latest
  • Browser: Safari 13.1.1
  • Other Information - stream.publish(this.rid) is undefined

What did you do?

Tried ion on Safari

What did you expect?

To work

What happened?

Didn't work

The problem is with LocalStream and RemoteStream classes, because they extend Stream which extends native MediaStream. A workaround that would be to add Object.setPrototypeOf(this, RemoteStream.prototype); in both constructors, as per this post: https://stackoverflow.com/questions/58471434/problem-extending-native-es6-classes-in-safari

Typescript type checking failing

I ran into this. I'm still look into what causes it. Let me know if you have any leads.

ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts(1,22):
TS6053: File 'project/node_modules/ion-sdk-js/decs.d.ts' not found.

  ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts(3,22):
TS7016: Could not find a declaration file for module 'protoo-client'. 'project/node_modules/protoo-client/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/protoo-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'protoo-client';`

ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/client.d.ts(20,42):
TS7016: Could not find a declaration file for module 'protoo-client'. 'project/node_modules/protoo-client/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/protoo-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'protoo-client';`

ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts(1,22):
TS6053: File 'project/node_modules/ion-sdk-js/decs.d.ts' not found.

  ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts(2,22):
TS7016: Could not find a declaration file for module 'protoo-client'. 'project/node_modules/protoo-client/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/protoo-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'protoo-client';`

ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts
ERROR in project/node_modules/ion-sdk-js/lib/stream.d.ts(43,35):
TS7016: Could not find a declaration file for module 'protoo-client'. 'project/node_modules/protoo-client/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/protoo-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'protoo-client';`

The @types declarations were also no beuno.

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.