JitsiConference.sendMessage() throws error when trying to send custom 'json-message'
See original GitHub issueDescription
When I try to send an object through the method sendMessage()
of the class JitsiConference
I receive an error.
The error also appears to be present at the current meet.jit.si
deployment.
lib-jitsi-meet.min.js:1 Uncaught TypeError: Cannot read property 'appendChild' of null
at Builder.c (lib-jitsi-meet.min.js:1)
at E.sendMessage (lib-jitsi-meet.min.js:10)
at ie.sendTextMessage (lib-jitsi-meet.min.js:10)
at ie.sendMessage (lib-jitsi-meet.min.js:10)
at <anonymous>:1:6
The documentation hints that this should be possible:
// JitsiConference.js:2636
/**
* Sends a message to a given endpoint (if 'to' is a non-empty string), or
* broadcasts it to all endpoints in the conference.
* @param {string} to The ID of the endpoint/participant which is to receive
* the message, or '' to broadcast the message to all endpoints in the
* conference.
* @param {string|object} message the message to send. If this is of type
* 'string' it will be sent as a chat message. If it is of type 'object', it
* will be encapsulated in a format recognized by jitsi-meet and converted to
* JSON before being sent.
* @param {boolean} sendThroughVideobridge Whether to send the message through
* jitsi-videobridge (via the COLIBRI data channel or web socket), or through
* the XMPP MUC. Currently only objects can be sent through jitsi-videobridge.
*/
JitsiConference.prototype.sendMessage = function(
message,
to = '',
sendThroughVideobridge = false) { ...
Current behavior
- The payload is correctly converted into a JSON string and the
elementType
is set tojson-element
- The
Strophe.Builder
throws an error and the payload is not sent.
Expected Behavior
- The payload is correctly converted into a JSON string and the
elementType
is set tojson-element
- The
Strophe.Builder
throws no error and the payload is sent.
Steps to reproduce
- goto https://meet.jit.si/
- start a random conference and join the room
- open the developer console
- send a message through the conference
window.APP.store.getState()["features/base/conference"].conference.sendMessage({foo: "bar"})
Environment details
Chrome, importing lib-jitsi-meet
from self-hosted server.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Lib-jitsi-meet JItsiConference.sendMessage performance
Hi, I am develope whiteboard with lib-jitsi-meet with custom jitsi-server which installed by docker. When i send drawing messages to room.
Read more >Jitsi
When I try to send an object through the method sendMessage() of the class JitsiConference I receive an error. The error also appears...
Read more >feat(polls) Ability to create polls inside Jitsi #9166
We could send custom XMPP messages using Strophe. · We could use the “sendMessage” method on the lib-jitsi-meet conference object to send “endpoint...
Read more >How to get specific error instead of Internal Server Error?
Let's say I have my controller and I implicitly throw an exception. @RestController public class HelloWorldController { @GetMapping("/hello- ...
Read more >lib-jitsi-meet API (low level) - GitHub Pages
After you receive the CONNECTION_ESTABLISHED event you are to create the JitsiConference object and also you may want to attach listeners for conference ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please, when you have questions or problems use the community forum before opening new issues, thank you.
window.APP.store.getState()["features/base/conference"].conference.sendMessage('some message')
@daimoc thanks for reopening this issue and take the time to have a second look.
I identified the
.up()
method which is called after the.c()
method, that attaches thejson-message
node as the reason for this error message.The documentation of
Strophe.Builder.c()
says:This appears to be not the case and the documentation is miss leading. If you provide a
string
ornumber
the methodc()
behaves liket()
I don’t have a correctly set up
lib-jitsi-meet
setup currently, therefore I can’t create a propper push requests with tests.You are doing a great job with the software, and I see your effort in giving good answers and be helpful in the forum. I searched for about 2 hours through the forum and was not sure this is the right place to discuss actual bugs. It appears to be a place where people ask for consultancy and don’t discuss issues like that.