ionorg / ion-sdk-js Goto Github PK
View Code? Open in Web Editor NEWion javascript sdk
License: MIT License
ion javascript sdk
License: MIT License
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.
Test ion-web-app with version 0.4.1 sdk
work
Error message:
WebSocket connection to 'wss://' failed: Error during WebSocket handshake: Unexpected response code: 200
通过signal中的call或者notify可以发送自定义的数据。看源码websocket被保护了,无法使用原生事件。
那该如何接收后台广播的自定义数据。从而实现一些定制化功能
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'))
MediaStreamTrack.enabled is false after localStream.mute('audio')
MediaStreamTrack.enabled is true after localStream.unmute('audio')
MediaStreamTrack.enabled always true
I tried to leave from a room using client.leave() to join other.
When i tried to use client.join(roomId), it throwed "rtc transport already exists for this connection".
Sorry I am quite new to this. Is there any documentation for this sdk to know the available functions and their parameters?
Who usage latest sdk to https://github.com/pion/ion-app-web ? help please setting
#155 need this feature first
Not sure the graceful way to add this feature :(
新版问题:
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 再次拿到之后 流 无法播放。
Get list of participants in room
To list participants names
在新的版本中,join方法中只有sid,offer。我该如何携带用户ID或者其他额外信息。
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):
on chrome, we use 111 for opus, 96 for vp8 and 102 for h264 ,as a reference
we should do this for firefox
test audio and video between firefox to firefox , firefox to chrome
other js bug on firefox
If anyone can help, that would be awsome!
Why we don't wait for sfu.join
finish then call this.onjoin
? I'm checking if sfu
is defined after onjoin
, but since sfu.join
is async there is no way to know if sfu.join
success or not.
https://github.com/pion/ion-sdk-js/blob/1e7603187c89afd15a83c6b8287b03149de42b06/src/ion.ts#L92-L106
Add new join config support (ionorg/ion-sfu@54cd1c2)
在版本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)
I am trying to mute only audio MediaStream by stream.mute("audio")
The sound should stop playing
Nothing happens. I continue to hear a sound.
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.
Would be great to support a IonSFUGRPCSignal
module using grpc-web
how we can sreeen share to other peer
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!
Add uid on stream-add and strem-remove events
I need uid to show or hide div
https://developer.mozilla.org/en-US/docs/Web/API/RTCOfferOptions/iceRestart
pc.oniceconnectionstatechange = function(evt) {
if (pc.iceConnectionState === "failed") {
if (pc.restartIce) {
pc.restartIce();
} else {
pc.createOffer({ iceRestart: true })
.then(pc.setLocalDescription)
.then(sendOfferToServer);
}
}
}
Add support for establishing p2p data channels between participants.
Useful for things like file sharing
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.
Once pion/webrtc#1200 is merged, we should implement support for simulcast.
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.
npm install ion-sdk-js
Module not found: Can't resolve './_proto/library/sfu_pb' in '/Users/dantruong/projects/video-test/node_modules/ion-sdk-js/lib/signal'
I expected the import to work.
I checked the node_modules and saw that the following was the ion-sdk-js directory structure:
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 using getDisplayMedia with audio. The steps are share screen -> mute -> unmute
The audio should not echoing or broken
The audio start echoing or broken, and after a while it will be annoying audio like cracking or something.
Running the code in readme with ts-node
The code running
Got an error of MediaStream is not defined
How to judge the loss of video stream?
When a browser video is closed, how do other browsers know that the video stream is closed?
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
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;
};
Bandwidth usage decreased
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"
export onconnectionstatechange so that:
user can catch and respond to Network interruptions or a change from wifi to another connection
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.
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.
ontrack
and stream-add
rtc messages?stream-add
rtc message? (I can submit a PR for this)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).
升级到1.0.21版本后,通过项目测试会报:
This relative module was not found:
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.
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
版本1.4.6 bug:
Hi,
Is there anyway to create the client with recvonly option? I simply just want to receive remote stream without publishing.
Thanks.
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.
Every call SDK has some type of stats API that can provide more insights about the call to the user.
Transport could provide access to RTCPeerConnection, in which case user can implement its own stats gathering logic.
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?
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!
1、为什么订阅一个流必须先加入房间
2、为什么必须拿到addstream才可以订阅流
Need a way to handle error connecting to websocket
Tried ion on Safari
To work
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.