Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

Unable to get stream of peer through peer ID. #274

Closed danishnazir closed 7 years ago

danishnazir commented 7 years ago

Hello there i am implementing the following scenario I have a learner which publishes the streams i.e screen sharing and video streaming.Now i have a Proctor which only views the learner stream and video stream and do not publishes its own streams.The thing is i have the peer id's of the learner and their streams but the scienario is that 1)Is it possible that at the Proctor end i dont use any IncomingStream and other functions to get the streams of the Learners? i do have the peer ids of the the learners (for both learner and screen sharing).If it is possible then how? 2)Is it possible to stop the media access at the proctor end? By this i mean that at the proctor end even though he is not publishing his stream the video is still being captured. @letchoo please take a look at this query Thanks

oooookk7 commented 7 years ago

Hi @danishnazir,

1) There is currently no way to retrieve the streams without the incomingStream event unfortunately, but if you like a separate method to get the list of Peer streams, we can consider that in future releases like for example a getPeerStreams() method that would return the list of Peer Streams.

2) Do you mean muting the Learners Streams or its Stream. So you do not want to send Stream for the Proctor only right but receive Streams from the Learners? If that is so:

var skylink = new Skylink();
skylink.joinRoom({
  audio: !isProtractor,
  video: !isProtractor
});

I hope I got your questions right and answers as well.

danishnazir commented 7 years ago

Thanks for your reply 1)Yeah that would be great if we can find a function like this. 2)I dont want to send the stream of the Proctor but receive the learners stream at the proctor end.

oooookk7 commented 7 years ago

Hi @danishnazir,

The example I provided you will resolve your issue where you receive but do not send :)

danishnazir commented 7 years ago

Thanks for the urgent reply, @letchoo one more thing i am using different JS files at both the proctor and learner end.Should i use same files for them in order to get better results? or it is upto me that how i manipulate the architecture?

oooookk7 commented 7 years ago

Hi @danishnazir,

You can definitely use the same JS skylink file for both end. Based on the flag above depending on how you detect one is Proctor and Learner, you can see if Stream should be send or not.

Btw do note that incomingStream event is useful because it tells you when a Peer's Stream is available.

danishnazir commented 7 years ago

@letchoo but the thing is if is use the same files then i would be receiving other learners streams at Learner end as well in the IncomingStream method which can cause bandwidth bottleneck?

oooookk7 commented 7 years ago

Hi @danishnazir,

Ahhh I see what you mean, so you just want to send Stream for Learner but not receive Stream, and as for the Proctor to receive Stream but not send Stream?

Regardless, it's possible to handle these 2 situations whether in the same file or separate. That would depend on how you prefer it to be.

danishnazir commented 7 years ago

Thanks @letchoo Exactly my point Sir

oooookk7 commented 7 years ago

Hi @danishnazir,

I see the point. It seems like if you are using 0.6.15, that would be unachievable situation for P2P connections. Is this urgently required? If not I suggest you wait for the 0.6.16 release to handle this situation.

danishnazir commented 7 years ago

Thanks Sir @letchoo the thing we are building our own product and we want to finish it as soon it is possible can you please tell me that how much estimated time will be required in order for you to provide this solution?

oooookk7 commented 7 years ago

Hi @danishnazir, 1-2 weeks possibly. If you urgently need them which I don't recommend since we will always advise you to build upon master branch releases, you can try finding them on:

https://github.com/Temasys/SkylinkJS/tree/0.6.x-development/publish

You can use https://rawgit.com/ to host them if needed.

danishnazir commented 7 years ago

Hi @letchoo thanks for your replies!! I think 1-2 weeks will be fine untill then we can work on something else.I am looking forward to it. Thanks one again :)

oooookk7 commented 7 years ago

No problem :)

oooookk7 commented 7 years ago

Hi @danishnazir, in the 0.6.16 release version, there is the getPeersStream() method which allows you to retrieve the list of Peer Streams. I'll be closing this ticket for now since the original issue has been resolved. Please open a new ticket when relevant.