Giter Club home page Giter Club logo

Comments (9)

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

Reason why you getting that error is because you are trying to list down participants without attaching to any plugin handle and you are right about the issue listparticipants should be called only after you have attached plugin
Let me explain what j.connect do
It just takes your passed server details along with credentials create a session id and initialize keep alive timer
At this point you might think you have room and you can interact with room but in real you can't unless you attach the plugin like videoroom videocall or any other this is achieved by method j.attach(Plugin(.... Now when you successfully attached the plugin only then you can use listparticipants or any other operation because attach function creates handle id for that plugin also you need to join the room as publisher/subscriber before issuing listparticipants hope that explains your doubt

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

About streaming you definitely need to attach a new streaming plugin but that should happen on recieving side

from flutter_janus_client.

alsiPanda avatar alsiPanda commented on July 28, 2024

Thanks @shivanshtalwar0 , that helped a lot, since I was pretty confused on how it worked exactly. I can now see the output from listparticipants in the terminal. But how do i get the output in a variable ? I tried var op = await plugin.send(....) but op prints as null. I also tried plugin.send( message: ... , onSuccess : (op){ print("$op"); } ) , still getting null. I couldn't get the user id from msg in onMessage either.

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

Reason why that happens is because send doesn't return anything and also in onSuccess you get nothing also because all this is supposed to work with both websocket and it is asynchronous in nature we cannot have future as janus_client is port of janusjs, all messages from the plugin can only be listened in onMessage handler where you attach plugin

from flutter_janus_client.

alsiPanda avatar alsiPanda commented on July 28, 2024

Hi @shivanshtalwar0 , I tried adding a print statement to onMessage everywhere and also added some marker text at the start of print to see if the response from listparticipant was being printed from within onMessage. But its not, the output from listparticipant is beung printed as :

I/flutter ( 9957): {janus: success, session_id: 6008204003696953, transaction: da2d7246-ffd7-40b5-b78e-24e1bb05d8ba, sender: 3435438303399251, plugindata: {plugin: janus.plugin.videor
oom, data: {videoroom: participants, room: 1234, participants: [{id: 1825063680612332, display: miladmin, publisher: false}]}}}

Where as both onMessages have print statement as print("publisheronmsg msg: $msg"); . The above print as you can see is not being printed from inside onMessage for some reason. There are other things getting printed from within onMessage such as response for room joined or room configured.

I/flutter ( 9957): publisheronmsg : {videoroom: joined, room: 1234, description: Demo Room, id: 7052290495258748, private_id: 1485829053, publishers: []}

I/flutter ( 9957): publisheronmsg : {videoroom: event, room: 1234, configured: ok, audio_codec: opus, video_codec: vp8}

Unless the response for listparticipant appears in onMessage, I assume there is no other way to parse the json and get user id ?

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

I am afraid I can't assist you without going through your code, if you can share a sample repository of your code then only I can be sure what is going wrong and if there exists a legitimate bug in the code

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

Ahh don't bother i got the bug fixing as i am writing this 😃

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

fixed now you should be able to get response of all participants , make sure to update pubspec yaml file like this

  janus_client:
      git: https://github.com/shivanshtalwar0/flutter_janus_client.git

and run flutter pub get and flutter pub upgrade

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

@alsiPanda new version out 0.0.4 with streaming support, all fixes, and improvements

from flutter_janus_client.

Related Issues (20)

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.